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: 625
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,180
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 Plugin: Thread|Github|Reapack] | [Routing Plugin: Thread|Reapack] | [More JSFX: Thread|Descriptions|Reapack]
sai'ke 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 03:04 AM.


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