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.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :( Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate 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: 5,265
|
I can confirm on Windows. On macOS it works correctly: it says "F1? 1.0" while the F1 key is pressed.
__________________
🎁 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui 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: 16,117
|
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
|
Oh right, yes. That's correct.
Thanks Justin.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :( Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate |
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.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :( Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate |
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.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :( Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate |
03-01-2017, 08:27 AM | #7 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,117
|
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.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :( Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate |
Thread Tools | |
Display Modes | |
|
|