Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
detect keyup
#2
Hi again,
Tilengine reports current button state. Detecting keydown or keyup involves detecting state transitions. For that you must keep previous value and compare it to current value, then reassign current to previous and process next frame. In pseudocode:


Code:
new = read()
if new == 1 and old == 0:
   keydown detected
elseif new == 0 and old == 1:
   keyup detected
endif
old = new

I don't have discord, but don't worry about posting small questions here Smile that's the point of the forum, to answer questions.
Reply


Messages In This Thread
detect keyup - by INVOKER - 01-06-2021, 09:04 AM
RE: detect keyup - by megamarc - 01-07-2021, 08:18 AM
RE: detect keyup - by INVOKER - 01-08-2021, 03:35 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)