|
|
|
02-25-2017, 08:42 PM
|
#1
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
API: gfx.getchar giving an incorrect value (FIXED)
A few people are having issues with their choice of keybind for my Radial Menu script: http://forum.cockos.com/showthread.php?t=186637
Specific to this thread, it won't work properly when bound to function keys. After some poking I found that gfx.getchar() will tell you that F1 is being held down (returns 26161), but gfx.getchar(26161) insists it's not. This breaks my script because I'm using gfx.getchar to check that the key is still down on every loop.
Test script here: https://dl.dropboxusercontent.com/u/...F1%20issue.lua
Install it, run it, hold down F1 and you should see that the message "F1?" is always false. (Esc will quit)
Cheers.
Last edited by Lokasenna; 03-01-2017 at 07:00 PM.
|
|
|
02-25-2017, 08:51 PM
|
#2
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
I can confirm on Windows. On macOS it works correctly: it says "F1? 1.0" while the F1 key is pressed.
Last edited by cfillion; 02-25-2017 at 09:10 PM.
|
|
|
02-25-2017, 09:00 PM
|
#3
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Looking in to this, thanks!
|
|
|
02-25-2017, 09:03 PM
|
#4
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Quote:
Originally Posted by cfillion
it says "F1? 1.0" while the F1 key is pressed.
|
Oh right, yes. That's correct.
Thanks Justin.
|
|
|
02-26-2017, 03:11 PM
|
#5
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
The F1 issue is fixed in the newest pre. Thanks for that.
Separately, and this isn't specific to the new prerelease, it looks like some keys aren't having their value reset to 0 after being pressed. That is, gfx.getchar(26161) returns 1 if F1 is pressed and 0 if it isn't, but keys like ~ (ASCII # 96) or § (ASCII # 167) continue returning 1 after being released.
Test script here: https://dl.dropboxusercontent.com/u/...%20checker.lua
Once you press a key, it'll check that key's status on every loop. The second column should go back to false, but not every key does.
Cheers again.
|
|
|
03-01-2017, 08:06 AM
|
#6
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Bumping and removing "FIXED" from the title because a couple more people have run into the issue in my previous post. Cheers.
|
|
|
03-01-2017, 08:27 AM
|
#7
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Hmm for those chars (things that get converted to WM_CHAR on Windows), you might just have to live with the limitation...
|
|
|
03-01-2017, 07:00 PM
|
#8
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Fair enough, thanks anyway.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:54 AM.
|