phantom Posted May 25, 2007 Share Posted May 25, 2007 Hello, inspired by the firefox plugin i decide to have a chop at making something similar but making it open what i choose.Hold down middle mouse button and move your mouse either left, right, up or down to perform the set gesture. I have seen something similar to this on the forum. www.autoitscript.com/forum/index.php?showtopic=32059&hl=Mouse+GestureSet gesture 1-4 through the tray menu, Heres the code:expandcollapse popup#include <Misc.au3> #include <GUIConstants.au3> Opt ("TrayAutoPause", 0);1 = pause Opt ("WinTitleMatchMode", 3);1 = default, 2 = substring, 3 = exact Dim $GUI, $OpenDefaultBrowser, $OpenMyComputer, $UD_open1, $UD_open2 $menu = TrayCreateMenu ("Set Gesture") $L = TrayCreateItem ("Set Gesture 1 (L)", $menu) $R = TrayCreateItem ("Set Gesture 2 (R)", $menu) $U = TrayCreateItem ("Set Gesture 3 (U)", $menu) $D = TrayCreateItem ("Set Gesture 4 (D)", $menu) TraySetState () While 1 Sleep (50) $msg = TrayGetMsg () Select Case _IsPressed ("04") GetGesture() Case $msg = $L Global $set = "1" If Not WinExists ("Gestures Setup") Then SetUp() Else WinSetState ("Gestures Setup", "", @SW_SHOW) SetUp() EndIf Case $msg = $R Global $set = "2" If Not WinExists ("Gestures Setup") Then SetUp() Else WinSetState ("Gestures Setup", "", @SW_SHOW) SetUp() EndIf Case $msg = $U Global $set = "3" If Not WinExists ("Gestures Setup") Then SetUp() Else WinSetState ("Gestures Setup", "", @SW_SHOW) SetUp() EndIf Case $msg = $D Global $set = "4" If Not WinExists ("Gestures Setup") Then SetUp() Else WinSetState ("Gestures Setup", "", @SW_SHOW) SetUp() EndIf EndSelect WEnd Func GetGesture() Local $pos_m = MouseGetPos () While _IsPressed ("04") $pos_n = MouseGetPos () Select Case $pos_n[0] < $pos_m[0] - 20 ToolTip ("L", 0, 0) Global $set = "1" Case $pos_n[0] > $pos_m[0] + 20 ToolTip ("R", 0, 0) Global $set = "2" Case $pos_n[1] < $pos_m[1] ToolTip ("U", 0, 0) Global $set = "3" Case $pos_n[1] > $pos_m[1] ToolTip ("D", 0, 0) Global $set = "4" EndSelect Sleep (100) WEnd If $pos_n[0] < $pos_m[0] - 20 Then DoGesture() ElseIf $pos_n[0] > $pos_m[0] + 20 Then DoGesture() EndIf If $pos_n[1] < $pos_m[1] Then DoGesture() ElseIf $pos_n[1] > $pos_m[1] Then DoGesture() EndIf EndFunc ;==>GetGesture Func SetUp() If WinExists ("Gestures Setup") Then If FileExists (@ScriptDir & "/Gestures Setup.ini") Then $check1 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open Default Browser", "none") $check2 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open My Computer", "none") GUICtrlSetState ($OpenDefaultBrowser, $check1) GUICtrlSetState ($OpenMyComputer, $check2) EndIf Else Global $GUI = GUICreate ("Gestures Setup", 177, 133) Global $Set2 = GUICtrlCreateButton ("Set", 8, 105, 161, 25) $DefaultFunctions = GUICtrlCreateTab (8, 8, 161, 95) GUICtrlCreateTabItem ("Gestures") Global $OpenDefaultBrowser = GUICtrlCreateCheckbox ("Open Default Browser", 16, 42, 137, 17) Global $OpenMyComputer = GUICtrlCreateCheckbox ("Open My Computer", 16, 66, 137, 17) GUICtrlCreateTabItem ("UD Gestures") Global $UD_Openg = GUICtrlCreateCheckbox ("Open file", 16, 42, 137, 17) Global $UD_Openg2 = GUICtrlCreateCheckbox ("Open file", 16, 66, 137, 17) If FileExists (@ScriptDir & "/Gestures Setup.ini") Then $check1 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open Default Browser", "none") $check2 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open My Computer", "none") GUICtrlSetState ($OpenDefaultBrowser, $check1) GUICtrlSetState ($OpenMyComputer, $check2) EndIf GUISetState () EndIf While 1 $msg = GUIGetMsg () Switch $msg Case $Set2 If GUICtrlRead ($OpenDefaultBrowser) = $GUI_CHECKED Then IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open Default Browser", "1") Else IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open Default Browser", "4") EndIf If GUICtrlRead ($OpenMyComputer) = $GUI_CHECKED Then IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open My Computer", "1") Else IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open My Computer", "4") EndIf If GUICtrlRead ($UD_Openg) = $GUI_CHECKED Then IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open File: " & $UD_open1, "1") Else IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open File: " & $UD_open1, "4") EndIf If GUICtrlRead ($UD_Openg2) = $GUI_CHECKED Then IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open File: " & $UD_open2, "1") Else IniWrite (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open File: " & $UD_open2, "4") EndIf MsgBox (0, "Set", "Options set.") Case $UD_Openg If GUICtrlRead ($UD_Openg) = $GUI_CHECKED Then Global $UD_open1 = FileOpenDialog ("Select file to open when gesture " & $set & " is done:", @HomeDrive, "All (*.*)") Else Sleep (10) EndIf Case $UD_Openg2 If GUICtrlRead ($UD_Openg2) = $GUI_CHECKED Then Global $UD_open2 = FileOpenDialog ("Select file to open when gesture " & $set & " is done:", @HomeDrive, "All (*.*)") Else Sleep (10) EndIf Case $GUI_EVENT_CLOSE WinSetState ("Gestures Setup", "", @SW_HIDE) Global $set = "" ExitLoop EndSwitch Sleep (30) WEnd EndFunc ;==>SetUp Func DoGesture() If FileExists (@ScriptDir & "/Gestures Setup.ini") Then Local $check1 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open Default Browser", "none") Local $check2 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open My Computer", "none") Local $check3 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open File: " & $UD_open1, "none") Local $check4 = IniRead (@ScriptDir & "/Gestures Setup.ini", "Gesture" & $set, "Open File: " & $UD_open2, "none") EndIf If $check1 = 1 Then ShellExecute ("www.google.com") ElseIf $check2 = 1 Then Run ("Explorer.exe /root, ,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") EndIf If $check3 = 1 Then ShellExecute ($UD_open1) ElseIf $check4 = 1 Then ShellExecute ($UD_open2) EndIf ToolTip ("") EndFunc ;==>DoGestureAfter looking at the code you can probably tell I still have much to learn. all comments welcome Link to comment Share on other sites More sharing options...
Cyber Posted May 25, 2007 Share Posted May 25, 2007 Very funny You have get me an idea I try to make gestureMenu Thanks! Sorry for my absurd English Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
phantom Posted May 25, 2007 Author Share Posted May 25, 2007 Haha np goodluck! Link to comment Share on other sites More sharing options...
Gif Posted May 25, 2007 Share Posted May 25, 2007 good script Link to comment Share on other sites More sharing options...
phantom Posted May 25, 2007 Author Share Posted May 25, 2007 (edited) good scriptThanks glad u liked it. Edited May 25, 2007 by phantom Link to comment Share on other sites More sharing options...
James Posted May 25, 2007 Share Posted May 25, 2007 (edited) I have made a gesture. But how do I play it? c4nm7 why dont you delete the post? Edited May 25, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
phantom Posted May 25, 2007 Author Share Posted May 25, 2007 if you set the gesture to 1 or "L" (Left) then hold the middle mouse button in and move it left then release and it should do what your have ticked. You should see a tooltip in the top left of your screen telling you which way your mouse is from the start position L,R,U or D. Link to comment Share on other sites More sharing options...
Gif Posted May 25, 2007 Share Posted May 25, 2007 c4nm7 why dont you delete the post?lol deleted it Link to comment Share on other sites More sharing options...
BillLuvsU Posted May 25, 2007 Share Posted May 25, 2007 Great implementation. Gives me ideas.... [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
James Posted May 26, 2007 Share Posted May 26, 2007 Ahh right. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
tonycst Posted September 18, 2013 Share Posted September 18, 2013 how does it work ? what gesture do i perform to activate it ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now