The only problem is that if a tired & emotional user holds down either the PageDown or PageUp key without releasing it for a few seconds, the key press messages get stacked up, and when the user finally takes his finger off the key, the app will continue scrolling through the db for quite a while.
Is there a way of increasing the time interval between auto-repeats for keyboard presses ? I've got a feeling this is probably an OS setting, but if anyone has any ideas, please let me know.
Code: Select all
on rawKeyDown theKeyNumber
-- handle PgUp, PgDn, Ctrl-Home & Ctrl-End keys
put the hilitedLine of field gGrid into tLineNo
put the number of lines of field gGrid into tTotalLines
if theKeyNumber is 65365 and the controlKey is up and tLineNo > 1 then -- PageUp
send "mouseUp" to button "btnPrev"
else if theKeyNumber is 65366 and the controlKey is up and tLineNo < tTotalLines then -- PageDown
send "mouseUp" to button "btnNext"
else if theKeyNumber is 65360 and the controlKey is down then -- Ctrl-Home
send "mouseUp" to button "btnFirst"
else if theKeyNumber is 65367 and the controlKey is down then -- Ctrl-End
send "mouseUp" to button "btnLast"
else
pass rawKeyDown -- don't forget this!
end if
end rawKeyDown