|
|
|
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('/');
with 32 bit Windows Reaper 6.10 on WinXPpro sp2, gc_a will toggle, but gc_1 & gc_slash get stuck on 1. i have reports of the same behavior on WIN10_64 REAPER64. same code works as expected on a mac.
|
|
|
06-09-2021, 02:28 PM
|
#2
|
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,453
|
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)
Press A, then 1, then 2. The last two don't release until the window has lost focus it seems.
|
|
|
07-31-2021, 10:56 AM
|
#3
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
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: 15,721
|
Improving this (somewhat)
|
|
|
07-31-2021, 01:29 PM
|
#5
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Quote:
Originally Posted by Justin
Improving this (somewhat)
|
Great! What's the "some" part of "somewhat"?
|
|
|
07-31-2021, 04:05 PM
|
#6
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Quote:
Originally Posted by tack
Great! What's the "some" part of "somewhat"?
|
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,619
|
Quote:
Originally Posted by Justin
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...
|
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,619
|
Quote:
Originally Posted by tack
Supposing the user presses shift-2, if I test for '2' instead of '@' will that work?
|
Answering my own question based on the latest dev build: no, it doesn't work.
|
|
|
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 07:21 PM.
|