AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GetKeyState() function returns U/D. Update: solved

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Bobo8



Joined: 09 Sep 2008
Posts: 5
Location: Czech rep.

PostPosted: Wed Oct 14, 2009 9:37 am    Post subject: GetKeyState() function returns U/D. Update: solved Reply with quote

GetKeyState() function does not return true (1) for down and false (0) for up, as is in Help, but returns "U"/"D".

Code:
#^o::
Sleep 2000
ShiftKey:=GetKeyState("Shift")
MsgBox %ShiftKey%
Return


[Moved from Bug Reports forum. ~jaco0646]


Last edited by Bobo8 on Sun Oct 18, 2009 5:42 pm; edited 2 times in total
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Oct 14, 2009 1:57 pm    Post subject: Reply with quote

Code:
MsgBox, % GetKeyState("Shift")


Returns properly 1 or 0 on my computer. Perhaps shift modifier is interfering?
Back to top
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Wed Oct 14, 2009 2:06 pm    Post subject: Reply with quote

Code:
!j::
MsgBox % GetKeyState("Shift")
Sleep 2000
ShiftKey:=GetKeyState("Shift")
MsgBox %ShiftKey%
Return


This also returns 1 or 0 properly on my PC. Have you been able to duplicate this problem with other keys?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
Bobo8



Joined: 09 Sep 2008
Posts: 5
Location: Czech rep.

PostPosted: Sun Oct 18, 2009 5:34 pm    Post subject: Reply with quote

The problem is in "#Include Function.ahk" (which I have downloaded form AHK forum), there is the function with the same name which returns "D"/"U"!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group