Xandl Posted May 15, 2008 Posted May 15, 2008 Hello, I am trying to set a keys up/down state using send("{key up/down}"). According to the docs, it looks like this method should work (example with "a" key there). My problem is that the key does not get released. I am aware about "SHIFTDOWN/UP", but i would like to use other keys as well. There is a test script below. How to test: - type in the edit. shift is not active. - press "SHIFT down" button - type in the edit. shift is pressed. - press "SHIFT up" button - type in the edit. shift is NOT released. (problem) - press and release your keyboards left shift key - type in the edit. shift is released now. GUICreate('send test',300,200) $down=GUICtrlCreateButton('SHIFT down',10,10,100) $up=GUICtrlCreateButton('SHIFT up',120,10,100) $ed=GUICtrlCreateEdit('type here to check LSHIFT status',0,50,300,150) ControlFocus('send test','',$ed) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $down Send("{LSHIFT down}") ControlFocus('send test','',$ed) Case $up Send("{LSHIFT up}") ControlFocus('send test','',$ed) EndSwitch Sleep(20) WEnd So how can I press/hold/release keys? thanks, xandl
d4rk Posted May 15, 2008 Posted May 15, 2008 Here :#512706 [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Xandl Posted May 15, 2008 Author Posted May 15, 2008 Here :#512706Thank you, but I am not sure this is exactly my problem.The point is, that I wonder why the explicit sent "up" does not work.I used "SHIFTUP/DOWN" first, this worked reliable.So I was hoping that the up/down options in send would work with "LSHIFT" or other keys, too.From the help:To hold a key down (generally only useful for games) Send("{a down}") ;Holds the A key down Send("{a up}") ;Releases the A keyciaoxandl
d4rk Posted May 15, 2008 Posted May 15, 2008 From the help file : {SHIFTDOWN} Holds the SHIFT key down until {SHIFTUP} is sent [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Xandl Posted May 15, 2008 Author Posted May 15, 2008 Hello, yes this is what I did first as you can see in my post. But why does the other method not work? I was hoping to be able to handle all keys the same way. ciao xandl
d4rk Posted May 15, 2008 Posted May 15, 2008 i see LSHIFT down/up in your code i'm mentionting about SHIFTDOWN/SHIFTUP [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
Xandl Posted May 15, 2008 Author Posted May 15, 2008 i see LSHIFT down/up in your codei'm mentionting about SHIFTDOWN/SHIFTUPYes, thats possible for five modifier keys, but what if I want the i.e. DEL key to be pressed, for a period of time?In this case, the events come from a gamepad device, from its buttons.What I want to do, is pressing/ holding/releasing keys corresponding to the buttons pressed/held/released on the gamepad.ciaoxandl
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