473,668 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delay the keyboard input for specified time

I am trying to create a textbox which would have a delayed input from
keyboard. For example when I press "A" it waits for 200 ms and only
after that time it passes the key to textbox. I tryed to do it with
ProcessCmdKey event which fires every time any key is pressed, but
there are arguments that do not contain information about the character
that should appear in textbox, but just the ASCII value of pressed key
(does not distinguish small or caps characters, not even to mention
local codepage chars). I tryed to just remember the params of
ProcessCmdKey event and manualy fire it later up, but with no success.
I also tryed to call an API SendMessage, but with no success.
Can someone please give me some pointers !

Thank You!!

Apr 5 '06 #1
2 4430
Why can't you use KeyPress event?
It is synchronous so that you can delay and it lets you decide wheiter to
send the key to textbox or not.

"Uveper" <ja***********@ leoss.si> ha scritto nel messaggio
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
I am trying to create a textbox which would have a delayed input from
keyboard. For example when I press "A" it waits for 200 ms and only
after that time it passes the key to textbox. I tryed to do it with
ProcessCmdKey event which fires every time any key is pressed, but
there are arguments that do not contain information about the character
that should appear in textbox, but just the ASCII value of pressed key
(does not distinguish small or caps characters, not even to mention
local codepage chars). I tryed to just remember the params of
ProcessCmdKey event and manualy fire it later up, but with no success.
I also tryed to call an API SendMessage, but with no success.
Can someone please give me some pointers !

Thank You!!

Apr 5 '06 #2
Hi,

You can use KeyPress as Laura suggesed, just be aware that it will slow all
your app as well.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Uveper" <ja***********@ leoss.si> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
I am trying to create a textbox which would have a delayed input from
keyboard. For example when I press "A" it waits for 200 ms and only
after that time it passes the key to textbox. I tryed to do it with
ProcessCmdKey event which fires every time any key is pressed, but
there are arguments that do not contain information about the character
that should appear in textbox, but just the ASCII value of pressed key
(does not distinguish small or caps characters, not even to mention
local codepage chars). I tryed to just remember the params of
ProcessCmdKey event and manualy fire it later up, but with no success.
I also tryed to call an API SendMessage, but with no success.
Can someone please give me some pointers !

Thank You!!

Apr 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
18823
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on Windows 2000 Server If you run the code below, you'll notice something odd occuring. The MilliSecond value does not change after a 1Millisecond delay. Is this a bug or am I doing something wrong? Any assistance will be greatly appreciated
9
9726
by: Marek Mand | last post by:
How to use generated keyboard events? What I am trying here to do is in onkeyup event handler http://www.hot.ee/idaliiga/braggart/createEventTest.htm generate a (shift)TAB keydown so the focus would move to the (previous/next ) input element. --
23
7727
by: herrcho | last post by:
What's the difference between STDIN and Keyboard buffer ? when i get char through scanf, i type in some characters and press enter, then, where do the characters go ? to STDIN or Keyboard buffer ? are they same ? thanks ^^
8
14761
by: John | last post by:
Hi all: Is there a C function to make a procedure sleep or delay for a few seconds/minutes on Linux and Sun OS platform? Thanks
6
5408
by: Trevor Hardwick | last post by:
Hi I'm Delay Signing an assembly. The Register for Com Interop property is set to true for all output files. When I build the solution I get the following error: "COM Interop registration failed. The check of the signature failed for assembly "
7
10635
by: Don Riesbeck Jr. | last post by:
I'm working on an application (OEM) using C# that utilizes input from a keyboard, and USB Barcode Scanner. The scanner is a HID Keyboard device, and input from it is sent to the system as if it were a keyboard. I need to be able to identify input from the scanner and keyboard independently. I've looked at DirectX.DirectInput, and using user32.dll to hook into the keyboard messages, but neither method seems to allow for identification of...
3
2997
by: NaN | last post by:
I've been trying to use _kbhit() but it didn't do what I thought it would from books, "Detects whether a keypress is available for reading." Herbert Schildt says, "If the user has pressed a key, this function returns true(non-0), but does not read the character. If no keystroke is pending, kbhit() returns false (0)." Here is the test code,
8
5293
by: BD | last post by:
How can I duplicate the behavior of the operating system shortcut keys in my application? For example, my windows form has 5 controls (textboxes), the operating system will pickup which control has the focus and handle ctrl-c, ctrl-v, or any other shortcuts. I have the same shortcuts working in my app, but have not determined how to find out which control has focus. Would I set up a loop or code for each control at form level. Any help...
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8799
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.