Jump to content
Sign in to follow this  
MDCT

StrokesPlus and AutoIt

Recommended Posts

MDCT

Hello, I want to share with you all something that I have just found recently and now it becomes my everyday companion in working with my computer.

First, some introductions about StrokesPlus.

Basically, this lightweight, free and portable program is a mouse gesture and hotkey management, so it can provide users with their own ways to interact with any applications. StrokesPlus already has a built-in Lua scripting and able to call external .dll with that alone S+ has became the most flexible mouse gesture and hotkey management. However, Lua scripting is not as convenient as AutoIt that we love when dealing with complex functions. So combined with AutoIt, StrokesPlus becomes one of the best apps to increase our productivity.

Example:

Hold Right mouse button while scrolling up to increase volume. There is a program that I know that could do this, however with that program it means the gesture (Right mouse button + wheel) is already taken for volume only. With StrokesPlus users could determine the gesture for which window, controls, and even parts of the screen. For example, upper left part of the screen for volume, upper center for screen brightness, etc. Look at the pictures in below link to know what I mean:

http://www.strokesplus.com/forum/topic/496/dyk-running-different-scripts-by-a-single-gesture

I'm sure advanced users could find other creative ways to work with StrokesPlus.

I think that's enough about the introductions.

Now to have a communication between StrokesPlus and AutoIt, one way is by using sendMessage from StrokesPlus to AutoIt.

It's very easy. First we determine a gesture to test, then set it for global, or app specific, or window title or win class specific. Then in the Lua script:

acSendMessage(acFindWindowByTitleRegex("GetTheGesture"), 273, 1, 1)

GetTheGesture = title of our AutoIt window that will received the message from StrokesPlus

273 = WM_COMMAND

1 = wParam

1 = the lParam

Then in the AutoIt script:

GUICreate("GetTheGesture")
Global Const $WM_COMMAND = 0x0111
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")

While 1
    Sleep(100)
WEnd

Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Local $Param1 = Dec(StringTrimLeft ($wParam, 2 ));LoWord
    Local $Param2 = Dec(StringTrimLeft ($lParam, 2 ))
    ConsoleWrite(" "&$Param1&"_"&$Param2&" ")
End Func

Now, each time we fire the gesture that we set to do sendMessage, the AutoIt script could receive it and start doing the works.

To make it more flexible, we could make the AutoIt script to get the window's control of where we do the gesture, instead sending the number for the app, send gsx, gsy from StrokesPlus. gsx, gsy represent the initial mouse position when we started the gesture. It depends of the users how they want to use it. This is one way that I know how to make connection, I believe there are other ways.

I can't believe I just recently know about this wonderful program. So, that's why I want to give you all some introductions. I'm sure many have heard about StrokeIt, however there has been no further release after 2010. While StrokesPlus is continously being developed. So, if anyone has any ideas or suggestions related, feel free to contact the author. The author would be very happy to hear it from you as he wants to create the most flexible but robust mouse gesture and hotkey management app.

Thank you for reading.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • WoodGrain
      By WoodGrain
      Hi guys,
       
      I've written a script that will move my mouse to a location on the screen whenever my remote access software becomes active, the problem I have is that as soon as the remote access software becomes active it appears to capture the mouse and keyboard so nothing happens when I use MouseMove().
       
      Is there any way around this?
       
      Thanks!
    • badcoder123
      By badcoder123
      Hey, all.  
      I've been looking for a way to change cursor colour but not the cursor itself. I've been looking for a couple hours now and can't find anything.  I also don't even know where to start, if anyone has any tips or examples please comment them.
      Thanks
    • Blois
      By Blois
      Hi Guis,
       
      I need to create keyboard shortcut to navigate the tabs and activate them, but I could not use the code below:
      #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #include <GUIConstantsEx.au3> HotKeySet("^{TAB}", "_TabRight") HotKeySet("^+{TAB}", "_TabLeft") $gui = GUICreate("test",450, 300) $Tab1 = GUICtrlCreateTab(20, 24, 425, 201) $TabSheet1 = GUICtrlCreateTabItem("Tabsheet 1") $lbContagemGrupos2 = GUICtrlCreateLabel("aaaa", 50, 50) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateTabItem("") $TabSheet2 = GUICtrlCreateTabItem(" ") $TabSheet3 = GUICtrlCreateTabItem(" ") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _TabRight() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos + 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Func _TabLeft() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos - 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Exit  
      can you help me?
    • guner7
      By guner7
      Hi everyone,
      I would like to share a simple snippet where I use for my hotkey script.
      I was searching for a solution whereby pressing a same key, I could have different outcome according to the way the key is being pressed.
      1) Double tap/press fast (like double click the mouse) - outcome A
      2) Long press or HOLD for awhile (2-4 sec) - outcome B
      #Include <Timers.au3> Global $interval_timer, $counter HotKeySet("{F10}", "_terminate") While 1 Sleep(10) WEnd Func _terminate() Local $itv_timer $itv_timer = _Timer_Diff($interval_timer) $interval_timer = _Timer_Init() ;ConsoleWrite($itv_timer & @CRLF) ;to review the timer difference so I can decide the range to capture double tap sequence If $itv_timer > 100 And $itv_timer < 250 Then $counter = 0 $interval_timer = _Timer_Init() MsgBox("","","double tap detected") Elseif $counter >= 25 Then $counter = 0 $interval_timer = _Timer_Init() MsgBox("","","long press detected") ElseIf $itv_timer < 50 Then $counter = $counter + 1 ConsoleWrite($counter & @CRLF) Else $counter = 0 EndIf EndFunc The trick here is to collect and use the frequency of the hotkey is called, and the time difference between each time the hotkey is being called.
      My coding style is not efficient and can be such a mess most of the time, any suggestion or better coding are welcome.
      I hope you find this one helpful.
    • Tarakesh
      By Tarakesh
      I have a situation where the desktop is designed in java swings. The nodes JTree is not allowing me to do checkbox selection using "spacebar". I am able to navigate through the nodes using up, down arrow and a tab. When I reach to the desire node selection, mouse left click is not working due a flaw a JTree core. However since it is selected, if mouse cursor auto moved to the position of the selection and send a "click"  then it should be solved. Any ideas much appreciated. 
      the problem with having fixed coordinates are the main windows is divided to 2panels where right panel containing this JTree can be expanded or shrink-ed.

×