Author Topic: Please log your input handling complaints here  (Read 2193 times)

0 Members and 1 Guest are viewing this topic.

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Please log your input handling complaints here
« on: January 12, 2021, 10:55:12 pm »
I'm planning to do a pass through the input handling code (mainly keyboard) soon and I'd like to kill a few birds with one stone. I'm vaguely aware there are several issues with input handling, but the only one I've got a definite record of is https://github.com/QB64Team/qb64/issues/101

If you could post any input bugs you've found below, I'll collate them and attempt to work through them together.

Please keep this to reproducible examples; code demonstrating a problem is much easier for me to deal with than paragraphs of prose.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Please log your input handling complaints here
« Reply #1 on: January 12, 2021, 11:29:43 pm »
I still use v1.3, but since then, did anyone remove the chr$(27) left arrow that appears if you press the Esc key while in a LINE INPUT statement?

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Please log your input handling complaints here
« Reply #2 on: February 02, 2021, 12:49:26 am »
Here's one that's currently affecting me:

ALT + Numpad keys

Code: [Select]
N = _NUMLOCK
DO
    k = _KEYHIT
    IF _NUMLOCK = 0 THEN _NUMLOCK ON
    IF _KEYDOWN(100308) THEN
        IF k <> 0 THEN
            PRINT k,
            IF ABS(k) < 255 THEN PRINT CHR$(ABS(k)) ELSE PRINT
        END IF
    END IF
    _LIMIT 30
LOOP UNTIL k = 27
IF N = 0 THEN _NUMLOCK OFF

Run the test code and hold down the ALT key, while hitting the keys on the number pad.

The only values you'll get as a trigger is the key up values (the negative numbers), with NO key down values.  Press and hold the key as long as you like -- there's no value for them until you let up on the key.

Which makes it kind of difficult to code Alt-### entry for ASCII codes for an input routine.  (Alt-158 to insert CHR$(158) into an user input, for example.)

I run into these type issues all the time with QB64's current input handlers, and have to try and hack some sort of work-around to make my code work as intended.  :P
« Last Edit: February 02, 2021, 01:46:04 am by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!