Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2007, 10:27 PM
Registered User
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Finding out which key has been pressed on keyboard

I'm trying to set up a global hot key, and I want to give the users of the app the ability specify their own key combo for the hotkey.

My problem is that I haven't been able to find a way to loop through the virtual keys to find out which one is pressed...

examples show doing

if (e.control && e.a) in the keydown event for a textbox... But how can I loop through each key to find out which one is which?

My goal is to:

A. Give the user the ability to set their own hot key (1 to 2 keys - can either be as simple as "shift" or it can be "shift+a")

B. Display in the text box an understandable meaning (left Shift + Right)

C. Do what ever to convert it to a system wide hot-key (Main purpose of the program is to play a sound when ever the hot key is pressed, and then another one when it is released).


I have been searching this out for weeks and keep coming up short - only way I can see doing this is to check specificaly for every key on the keyboard using an if statement..

Thanks,


Seth






Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Primary Key Column in Script johnpirkey SQL Server 2000 9 April 26th, 2007 10:06 AM
handling asp buttons when pressed enter key g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 January 16th, 2006 05:06 PM
Executing a file when button pressed scoobie Pro PHP 1 May 10th, 2005 05:35 AM
Saving Buttons pressed BigH140 Access VBA 17 October 28th, 2004 05:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.