Travis Posted December 20, 2012 Share Posted December 20, 2012 So i use the following function in this program I am writing Hotkeyset("{ASC 097},"randomfunc") For some reason, the ascii character 097 (which corresponds to the lower-case alphabet character "a") only wants to work when I type a CAPITAL A (shift + A) If I change the ascii code to the proper code for a capital A, it works fine just like it should. But in this case I can't seem to capture a lowercase letter. Here is the program that I have so far, you can run it and I would be interested in what results you get. Hotkeyset("{ASC 097}","randomfunc") While 1 Sleep(100) WEnd Func randomfunc() msgbox(0,"","detected a stroke") ;$file = fileopen("c:\users\travis\desktop\test.txt",1) ;filewriteline($file,"a")a EndFunc Note that I've commented-out the lines that involve writing a file to your (likely) non-existant desktop for user: Travis. Link to comment Share on other sites More sharing options...
lopolop Posted December 20, 2012 Share Posted December 20, 2012 Key log with: HotKeySet( "a", "randomfunc" ) Link to comment Share on other sites More sharing options...
Travis Posted December 20, 2012 Author Share Posted December 20, 2012 OK I will try that in a few minutes. I just followed the help file and it said to use a three number ascii code for letters in the format {ASC 123}, etc. Link to comment Share on other sites More sharing options...
lopolop Posted December 20, 2012 Share Posted December 20, 2012 {ASC 097} is the right code for 'a'. Link to comment Share on other sites More sharing options...
Travis Posted December 20, 2012 Author Share Posted December 20, 2012 lopolop, indeed is the right ascii code. But it doesn't want to capture the a character for some reason. The capital A character captures fine on both codes (like, the correct code and 097). But I just used Hotkeyset("a","randomfumc") and it worked fine. Maybe the help file was not updated since an older version of autoit or something like that. 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