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

Reply
 
Thread Tools Display Modes
Old 05-14-2020, 10:14 AM   #1
bang
Human being with feelings
 
bang's Avatar
 
Join Date: Jul 2006
Posts: 626
Default 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.
bang is offline   Reply With Quote
Old 06-09-2021, 02:28 PM   #2
sai'ke
Human being with feelings
 
sai'ke's Avatar
 
Join Date: Aug 2009
Location: NL
Posts: 1,563
Default

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.
__________________
Tracker: Thread|Github|Reapack | Routing: Thread|Reapack | JSFX: Thread|GitHub|Reapack | YSFX
sai'ke is offline   Reply With Quote
Old 07-31-2021, 10:56 AM   #3
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
Default

Ran into this bug as well.

REAPER 6.33 on Windows 10.

Last edited by tack; 07-31-2021 at 11:03 AM.
tack is offline   Reply With Quote
Old 07-31-2021, 12:34 PM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,124
Default

Improving this (somewhat)
Justin is offline   Reply With Quote
Old 07-31-2021, 01:29 PM   #5
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
Default

Quote:
Originally Posted by Justin View Post
Improving this (somewhat)
Great! What's the "some" part of "somewhat"?
tack is offline   Reply With Quote
Old 07-31-2021, 04:05 PM   #6
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,124
Default

Quote:
Originally Posted by tack View Post
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...
Justin is offline   Reply With Quote
Old 07-31-2021, 04:11 PM   #7
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
Default

Quote:
Originally Posted by Justin View Post
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?
tack is offline   Reply With Quote
Old 08-02-2021, 04:10 PM   #8
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
Default

Quote:
Originally Posted by tack View Post
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.
tack 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 10:16 PM.


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