Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How do you block typematic


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Feb 19, 2016 11:20 AM Last Post By: Jorge Uriarte
Jorge Uriarte

Posts: 41
Registered: 11/28/14
How do you block typematic  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2016 9:42 AM
While I press a key, I don't want the keypress to repeat. How do I block typematic?
Any advice will be appreciated
Jorge
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: How do you block typematic  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2016 10:24 AM   in response to: Jorge Uriarte in response to: Jorge Uriarte
Jorge Uriarte wrote:

While I press a key, I don't want the keypress to repeat. How do I
block typematic? Any advice will be appreciated
Jorge

Well, you can do that (in a Delphi app, I assume), but I'm not sure
whether it would be a good idea.

Go here: http://edn.embarcadero.com/article/38447
The article details how key processing works in Windows for a Delphi
application. You need a handler for the Application.OnMessage event,
where you can watch for WM_KEYDOWN messages and inspect their
parameters (see
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646280%28v=vs
.85%29.aspx ). What you need to look at is bit 30 of the message
lparam, if it is set the message is the result of autorepeat and you
can discard it by setting the Handled parameter of the event handler to
true.

--
Peter Below
TeamB
Jorge Uriarte

Posts: 41
Registered: 11/28/14
Re: How do you block typematic  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2016 11:20 AM   in response to: Peter Below in response to: Peter Below
Peter Below wrote:
Jorge Uriarte wrote:

While I press a key, I don't want the keypress to repeat. How do I
block typematic? Any advice will be appreciated
Jorge

Well, you can do that (in a Delphi app, I assume), but I'm not sure
whether it would be a good idea.

Go here: http://edn.embarcadero.com/article/38447
The article details how key processing works in Windows for a Delphi
application. You need a handler for the Application.OnMessage event,
where you can watch for WM_KEYDOWN messages and inspect their
parameters (see
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646280%28v=vs
.85%29.aspx ). What you need to look at is bit 30 of the message
lparam, if it is set the message is the result of autorepeat and you
can discard it by setting the Handled parameter of the event handler to
true.

--
Peter Below
TeamB

Thanks Peter! I got it all working!
Jorge
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02