473,651 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keyboard capture problem

I've written a simple application. It consists of main window, menu and a
label. I added event handler to the main form (KeyDown), so when I push a
key on the keyboard, then it's key code should be displayed using a label
(label.Text = e.KeyCode). It works fine with "A", "B" etc. but when I press
left arrow, up arrow etc, the main menu popups and KeyDown event is not
handled.
What should I do ?
PS. I use .NetFramework 2.0 Beta2. In .NetFramework 1.1 there wasn't such
problem.

Emil.
Nov 17 '05 #1
1 1539
"Emil" <em******@op.pl > wrote in message
news:d5******** *@nemesis.news. tpi.pl...
I've written a simple application. It consists of main window, menu and a
label. I added event handler to the main form (KeyDown), so when I push a
key on the keyboard, then it's key code should be displayed using a label
(label.Text = e.KeyCode). It works fine with "A", "B" etc. but when I
press left arrow, up arrow etc, the main menu popups and KeyDown event is
not handled.
What should I do ?


Have a look at the virtual function ProcessCmdKey() that all WinForms
inherit. You can get at the keyboard keys at a lower level than the
keydown event.

-- Alan
Nov 17 '05 #2

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

Similar topics

2
3411
by: Patricio Stegmann | last post by:
Hello, I'm trying to capture all keyboard events from some different web page layouts: framesets with different stuff, like flash or whatever ! The problem I am getting is that only focused documents get those events, and even worse, if an "object" like a swf clip gets the focus, all keyboard events are only sent to that object. What I would like is to be able to get the events to a particular script/function so I can handle them...
0
1605
by: chewie | last post by:
Does anyone know how to capture keyboard scan codes using C#? Thanks
0
1224
by: John | last post by:
I used GetMessage() to capture the VK_ Message, but false. how to capture the Keyboard message?
4
4522
by: teddysnips | last post by:
I posted yesterday about a project I'm involved in to build a login application using a barcode scanner. I've solved most of the problems, but one remains. The client want to disable keyboard input (except at some remote sites where there won't be a scanner). The session "knows" whether that site should be keyboard enabled, but unfortunately the output from the scanner is in the form of keypresses! So any attempt to capture and...
2
9210
by: hans.duedal | last post by:
The Gecko DOM reference gave me the idea that an onscreen keyboard I was doing should use Key Events, so the user may for instance place a letter anywhere, and such. While this can be handled using a number of hacks, I really want to use events, since they seem like the "right" way to do an onscreen keyboard. Just fire the key events associated with the button on screen right? With Firefox this worked great, and so did it for IE, BUT, IE...
2
5972
by: Justin | last post by:
So I have a keyboard hook that I have implemeted into my c# app. I need to not allow any hotkey actions to be performed when my app is opened. I can capture the key events and handle them if I want to. The only problem is that I have fields that require input. Do I have to programmatically add the characters to the input fields when I am handling the event. I don't want these keys sent to the system. But only to my program. Or does...
5
9083
jamesd0142
by: jamesd0142 | last post by:
hi guys i want to create a form which runs in the background which is not visible... so far so good... now... how can i get it to capture all keyboard input, so that i can say if f10 is pressed start word etc... i can do this using the form.keypress method when the form is selected. But i want to capture all keyboard input when the form is not selected so if a user(me) was browsing the web, and pressed f10 it wud still start word... ...
9
3484
by: Peter Blues | last post by:
I'm trying to write from keyboard input to a txt file. I don't understand why the while loop below doesn't achieve this. I.. 1: open the file for writing through FILE pointer outstream 2: I get chars one at a time as ints(ascii) through fd using getchar() 3: Copy from fd to FILE *outstream using fputc() 4: Finally close outstream. I feel the problem lies in step 2 and 3. Can someone please explain where the following code is wrong.
0
8278
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
8807
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
8701
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...
1
8466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6158
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
5615
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();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.