Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How fast is your OSes keyboard input?
#7
I'm a fan of _LIMIT 30. My reasoning is more human than computer based. I always heard that old acetate film reels ran at 24 frames per second, and at that rate the human eye and brain perceived fluid motion from the individual frames. Thus I figured 30 was an even better number, and easily beyond our reaction and perception times. I generally don't perceive anything jerky or delayed in most of my programs, except if there is a definite bug in the works. 

I usually do a dual nested loop that grabs input on the inner one, whether keyboard or mouse, and that loop is limited and exited via an input flag each time a legitimate input is received and processed. The outer loop refreshes the display and has no limit as it's a one time thing and the input loop is re-entered. So 99.99...% of the time my programs are polling an INKEY$ and a quick call to Steve's MBS function at 30 loops per second. I have no issues leaving programs, like my harvesting database, running for many hours. Which they have to do.

Sometimes I'll notice a lag in some screen feature following a mouse cursor, but since I'm not a fast action game programmer, that scheme works fine in my programs. I haven't done any mouse dragging stuff yet to see if it causes issues.

P.S. After trying Steve's tests, I'd say I'm about right. The first yielded 30-31 just holding a key down and the second ran at a consistent 31.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
RE: How fast is your OSes keyboard input? - by OldMoses - 08-10-2022, 11:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mix mode input of a binary open file Question! doppler 5 1,513 11-28-2024, 03:06 PM
Last Post: Petr
  What keyboard do you use for QB64 PE? vividpixel 14 2,838 06-28-2024, 11:02 PM
Last Post: SMcNeill
  3.13.1 bug report - keyboard characters swapped Circlotron 3 1,026 06-03-2024, 05:16 AM
Last Post: Circlotron
  I need input on a possible bug in v3.5.0 TerryRitchie 50 8,670 05-22-2024, 07:03 PM
Last Post: TerryRitchie
  Input routine dano 9 1,592 05-21-2024, 03:50 AM
Last Post: grymmjack

Forum Jump:


Users browsing this thread: 1 Guest(s)