I need to prevent the user to keep a button pressed down and thereby gaining more clicks registered than was intended.
Does anyone have any suggestions on how to do this?
Thanks in advance
Peter
Prevent a key pressed, to repeat its characters?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Prevent a key pressed, to repeat its characters?
/*Whats all the fuss with c# ?*/
Re: Prevent a key pressed, to repeat its characters?
Hi Peter,
I use this:
Best regards
Jean-Marc
I use this:
Code: Select all
local sStarTime
on opencard
put the milliseconds into sStarTime
end opencard
on mouseUp
put the milliseconds into tTime
if tTime > sStarTime +500 then
beep
else
-- do your stuff
end if
put the milliseconds into sStarTime
end mouseUp
Jean-Marc
https://alternatic.ch
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Re: Prevent a key pressed, to repeat its characters?
Thanks, but I forgot to mention that it is the keyboard buttons, and not mouse click, I need to handle
I use the keyDown message, and that messages will continue to loop as long as the button is pressed, and that is what I want to prevent.
/Peter
I use the keyDown message, and that messages will continue to loop as long as the button is pressed, and that is what I want to prevent.
/Peter
/*Whats all the fuss with c# ?*/
Re: Prevent a key pressed, to repeat its characters?
What about this:
Code: Select all
on rawkeydown pKey
put the milliseconds into tTime
if tTime > sStarTime +500 then
put the milliseconds into sStarTime
pass rawkeydown --or do your stuff
else
--
end if
put the milliseconds into sStarTime
end rawkeydown
https://alternatic.ch
Re: Prevent a key pressed, to repeat its characters?
Peter.
Make sure you include Jean-Marc's earlier openCard handler if you use his second suggestion.
Craig Newman
Make sure you include Jean-Marc's earlier openCard handler if you use his second suggestion.
Craig Newman