Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 02-25-2017, 08:42 PM   #1
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default 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.
Lokasenna is offline   Reply With Quote
Old 02-25-2017, 08:51 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

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.
cfillion is offline   Reply With Quote
Old 02-25-2017, 09:00 PM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Looking in to this, thanks!
Justin is offline   Reply With Quote
Old 02-25-2017, 09:03 PM   #4
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by cfillion View Post
it says "F1? 1.0" while the F1 key is pressed.
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
Lokasenna is offline   Reply With Quote
Old 02-26-2017, 03:11 PM   #5
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

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
Lokasenna is offline   Reply With Quote
Old 03-01-2017, 08:06 AM   #6
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

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
Lokasenna is offline   Reply With Quote
Old 03-01-2017, 08:27 AM   #7
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Hmm for those chars (things that get converted to WM_CHAR on Windows), you might just have to live with the limitation...
Justin is offline   Reply With Quote
Old 03-01-2017, 07:00 PM   #8
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

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
Lokasenna is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.