Sorry for the late response.
Yes GETKEY() is in the help accessed via the F1 key. Press F1 while the cursor is on the word GETKEY() in the editor to jump directly to it, or to find it in help look in the Methods category and geykey will be in the list. You will also find in the Constants category a list of contant names beginning with KEY_ that you can use with it.
However, Getkey is a bit simple and has the limitation similar to reading a key from BASIC in that it only returns one key press value. Press two or more keys at the same time and only one of them will win out.
I'll hold my hands up here that this implementation is a fault on my part due to what I knew / learnt at the time of implementing a getkey() function in TRSE (for the Vic 20) and also that I've not had a requirement to detect more than one keypress before (as my first two games expected joystick controls). Generally, TRSE is improved by people using it and requesting functionality and for a time there was only me supplying requirements and fulfilling them

Thankfully, there has been more interest from Vic 20 programmers using TRSE in recent weeks which is keeping me busy.
I will add some better support for the keyboard in TRSE programs in the future, but until then if you want to test if two or more keys are pressed at the same time, this is what I have figured out. Add a bit of inline assembly to your TRSE code:
Code: Select all
asm("
lda #127 ; put the row number in here from the table linked below
sta $9120
lda $9121 ; the result is bits 0-7 being 'off' (0) for each key in that row currently held down
sta YourTRSEvariable ; store the result in a trse variable if you want to, or do your own asm here
");
Change the first line value (127) to the row you want test a key being held down on, the values are in the table below. Reading from $9121 will give you 8 bits to test, each bit represents a key from that row. For example, with row 127, you can detect keys F7, HOME, -, 0, 8, 6, 4 and 2. To see if key '2' is held, you need to check if bit 0 is clear. Repeat the above asm if there are keys on other rows you want to test. Hope that helps
View key mappings