05-14-2020, 10:14 AM | #1 |
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Jsfx: gfx_getchar(char) broken for non-alphabetics on Windows
gfx_getchar(char) for non-alphabetic characters on Windows returns 0 after a Jsfx starts, changes to 1 when char is pressed, but never changes back to 0. this code shows the problem in the Js editor:
Code:
@gfx gc_a= gfx_getchar('a'); gc_1= gfx_getchar('1'); gc_slash= gfx_getchar('/'); |
06-09-2021, 02:28 PM | #2 |
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,563
|
Seems to be the case for reascript too. It seems internally the release isn't actually releasing.
Code:
function update() char = gfx.getchar() gfx.set(0, 0, 0, .5) gfx.rect(0, 0, gfx.w, gfx.h); gfx.update() gfx.setfont(2, "Arial", 16); gfx.x = 0; gfx.set(1, 1, 1, 1); if gfx.getchar(97) == 1 then gfx.printf("A") end if gfx.getchar(49) == 1 then gfx.printf("1") end if gfx.getchar(50) == 1 then gfx.printf("2") end if char ~= -1 then reaper.defer(update) else gfx.quit() end end gfx.init("ohnoes", 160, 60, 0, 60, 60) reaper.defer(update) |
07-31-2021, 10:56 AM | #3 |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
Ran into this bug as well.
REAPER 6.33 on Windows 10. Last edited by tack; 07-31-2021 at 11:03 AM. |
07-31-2021, 12:34 PM | #4 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,124
|
Improving this (somewhat)
|
07-31-2021, 01:29 PM | #5 |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
Great! What's the "some" part of "somewhat"?
|
07-31-2021, 04:05 PM | #6 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,124
|
Due to complexities of Windows keyboard handling and eel_lice.h's somewhat-crappy implementation, it will still be broken for querying the state of modified keys (e.g. '@' on a US-eng keyboard). But '/' and '1' should work...
|
07-31-2021, 04:11 PM | #7 |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
Supposing the user presses shift-2, if I test for '2' instead of '@' will that work?
|
08-02-2021, 04:10 PM | #8 |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
Answering my own question based on the latest dev build: no, it doesn't work.
|
Thread Tools | |
Display Modes | |
|
|