StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
X9dZQm2wSvHpqr  
#1 Posted : Saturday, May 9, 2020 10:59:45 AM(UTC)
X9dZQm2wSvHpqr

Rank: Newbie

Reputation:

Groups: Approved
Joined: 12/12/2019(UTC)
Posts: 3
China

Was thanked: 2 time(s) in 2 post(s)
Hello there!
S + supports right mouse button, middle button, left button, X1, X2, to start gestures,
I want to be able to support custom keys to initiate gestures.
This can make some mouse buttons more effective.

I do n’t understand English, this section uses Google Translate, I hope you can understand it.BigGrin
thanks 1 user thanked X9dZQm2wSvHpqr for this useful post.
whydothis on 6/11/2020(UTC)
halikjk  
#2 Posted : Saturday, May 9, 2020 1:39:46 PM(UTC)
halikjk

Rank: Newbie

Reputation:

Groups: Approved
Joined: 7/23/2019(UTC)
Posts: 1
United Kingdom

It is already there. <<<""Modifiers"">>> Control, Alt, Shift
Modifiers
X9dZQm2wSvHpqr  
#3 Posted : Sunday, May 10, 2020 12:22:51 AM(UTC)
X9dZQm2wSvHpqr

Rank: Newbie

Reputation:

Groups: Approved
Joined: 12/12/2019(UTC)
Posts: 3
China

Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: halikjk Go to Quoted Post
It is already there. <<<""Modifiers"">>> Control, Alt, Shift
Modifiers


Thank you for your reply.
I am not going to use modifier keys.
I hope it can be used directly, with custom keys to initiate gestures.
For example, only use the "A" key, and don't use other keys to trigger gestures.
thanks 1 user thanked X9dZQm2wSvHpqr for this useful post.
whydothis on 6/11/2020(UTC)
liuxilu  
#4 Posted : Sunday, May 10, 2020 3:12:24 AM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/5/2020(UTC)
Posts: 75
China

Thanks: 1 times
Was thanked: 20 time(s) in 20 post(s)
热键可以设单个键
X9dZQm2wSvHpqr  
#5 Posted : Sunday, May 10, 2020 3:19:07 AM(UTC)
X9dZQm2wSvHpqr

Rank: Newbie

Reputation:

Groups: Approved
Joined: 12/12/2019(UTC)
Posts: 3
China

Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: liuxilu# Go to Quoted Post
热键可以设单个键


你是指“热键”功能中,有命令可直接触发手势吗?
luper  
#6 Posted : Sunday, September 6, 2020 4:34:39 PM(UTC)
luper

Rank: Newbie

Reputation:

Groups: Approved
Joined: 9/6/2020(UTC)
Posts: 1

hi, there is a chance to use only a key to start gesture? For example alt key
Rob  
#7 Posted : Monday, September 7, 2020 9:53:25 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 684
United States
Location: Tampa, FL

Thanks: 13 times
Was thanked: 155 time(s) in 134 post(s)
So this is kind of a hack (and not really a perfect solution), but if you go to the Downloads page and scroll to bottom, enter 0.3.9.5 and download, you can try this out.

In your action, select the Alt key as a modifier (if you're using that key in the script as I have below), since that will part of the recognition if you're holding it - then add the script below in the Load tab. The sp.StartManualCapture action accepts true/false, false is default and signals capturing the Primary stroke button, true tells the capture to simulate the Secondary stroke button (this is relevant to how the action action is configured).

Global Actions > Load/Unload > Load tab

Code:
if(__spEngineWrapper.Engine.Name == sp.EngineList().Last().Engine.Name)
{
    var keyboardEventObj = sp.GetStoredObject("keyboardEvent");
    if(!keyboardEventObj.GetType().FullName.includes('EventConnection'))
    {
        //Uncomment the line below if you do not want S+ to capture on mouse button down
        //sp.ManualCaptureOnly = true;

        //Bind to the asynchronous event (non-blocking)
        var keyboardEvent = KeyboardHook.OnKeyboardHookEventAsync.connect(
            function (sender, keyboardHookEvent) {
                try
                {
                    //If the Left or Right Alt key is pressed/released
                    if(keyboardHookEvent.Key == vk.LMENU || keyboardHookEvent.Key == vk.RMENU)
                    {
                        //Alt key is down, start gesture capture
                        if(keyboardHookEvent.KeyState == KeyState.Down)
                        {
                            sp.StartManualCapture(); //Simulates pressing the Primary stroke button
                            //sp.StartManualCapture(true);  //Use this to simulate the Secondary stroke button
                        }
                        else
                        {
                            //Alt key released, stop capture and process gesture
                            sp.StopManualCapture();
                        }
                    }
                }
                catch {}
            });
        sp.StoreObject("keyboardEvent", keyboardEvent);
    }
}


At some point I may need to make a truly supported key method, but it's not something the majority of people request, and it adds a layer of complexity to the hooks.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.