Keyboard input/Keypress check: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(FutureBasic solution added) |
||
Line 796: | Line 796: | ||
The key pressed was A (ascii 65) |
The key pressed was A (ascii 65) |
||
</pre> |
</pre> |
||
=={{header|FutureBasic}}== |
|||
<syntaxhighlight lang="futurebasic"> |
|||
_window = 1 |
|||
void local fn BuildWindow |
|||
subclass window _window, @"Keyboard input/Keypress check" |
|||
text,24 |
|||
print %(180,190)@"Press any key" |
|||
end fn |
|||
void local fn DoDialog( ev as long, tag as long ) |
|||
select ( ev ) |
|||
case _windowKeyDown |
|||
select ( tag ) |
|||
case _window |
|||
cls : printf %(180,190)@"\"%@\" key pressed",fn EventCharacters |
|||
DialogEventSetBool( YES )// we handled |
|||
end select |
|||
end select |
|||
end fn |
|||
fn BuildWindow |
|||
on dialog fn DoDialog |
|||
HandleEvents |
|||
</syntaxhighlight> |
|||
=={{header|Gambas}}== |
=={{header|Gambas}}== |