Bug #175
KEY STATE
0%
Description
KEY STATE doesnt work as in the Amiga-days.
Inkey$ gets the pressed key from the keybuffer. Key State checks if the key is pressed (so that you kan hold a key down and still get checked).
Key State doesnt give True as expected.
Updated by Francois Lionet about 4 years ago
- Status changed from New to Feedback
- Target version set to 0.9.5
Can you provide an example? Can you send me a .AMOS application that I will run on in WinUAE and AOZ at the same time? You do not say enough information for me to do anything...
thanks.
Updated by Brian Flanagan about 4 years ago
- Affected version changed from 0.9.4 to 0.9.5
The key state should return True if the key identified by the specified scan code is currently held down. It will continue to return True until that key is released. It will check the state of ANY key, including Ctrl, Shift, etc.
NOTE: It can also detect many keys held down at the same time.
NOTE: Some keys may produce more than one key state.
Note the related bug #113 (Scancode is returning the wrong scan codes.), so this will also adversely affect the results until that is fixed.
Here's an example:
Do For SC=0 To 127 If Key State(SC)=True Then Print SC Next SC Loop
Some sample results should be:
ESC, HELP should return: 69, 95 LEFT SHIFT, RIGHT SHIFT should return 96, 97 RETURN, KEYPAD RETURN should return 69, 67 Left Windows (Left Amiga) should return 102 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 should return 80 81 82 83 84 85 86 87 88 89 (some PCs will take control of these) 1 2 3 4 5 6 7 8 9 0 - = (top row of keys [partial]) should return 1 2 3 4 5 6 7 8 9 10 11 12. q w e r t y u i o p [ ] (next row of keys [partial]) should return 16 17 18 19 20 21 22 23 24 25 26 27 a s d f g h j k l ; - (third row [partial]) should return 32 33 34 35 36 37 38 39 40 41
Note: Changed affected version from 0.9.4 to 0.9.5, since it's still broken.
Updated by Baptiste Pillot about 4 years ago
- source : https://www.amos2.fr/ide/Amos2/Ide/Program/495
- run : https://www.amos2.fr/run/tickleman/175
- 0.9.6 result : If I press any of ESC or LEFT keys : Magician Meditation
- console :
Cannot read property 'loChar' of undefined aoz.js:418 TypeError: Cannot read property 'loChar' of undefined at Fonts.getAmigaCharacter (fonts.js:440) at Fonts.drawAmigaText (fonts.js:428) at TextWindow.printLine (textwindow.js:1648) at TextWindow.print (textwindow.js:1282) at Application.blocks.<computed> (application.js:55) at doUpdate (aoz.js:405)