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



Users browsing this thread: 6 Guest(s)