473,322 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Differentiating between RControl and LControl with C#

Hi Folks,

I'm trying to write a program that will differentiate between which 'Ctrl'
key is pushed, the left or right.

Here's the code I have:

void OnKeyUp(object sender, KeyEventArgs kea)
{
if (kea.KeyCode == System.Windows.Forms.Keys.LControl)
{
this.Player1Timer.Stop();
this.Player2Timer.Start();
}
else
{
if (kea.KeyCode == System.Windows.Forms.Keys.RControl)
{
this.Player1Timer.Start();
this.Player2Timer.Stop();
}
}
}

Unfortunately when the KeyUp event fires it only sends that 'Keys.Control'
was pushed. Does anyone know of a way to find out which key it was? I seems
weird that they include Keys.LControl and Keys.Rcontrol but then don't use
them.

Thanks for your time.

Nov 17 '05 #1
0 1160

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

Similar topics

1
by: Tim Stanka | last post by:
Thanks in advance for any responses. I have an application which embeds Python. I also have a command window for using Python interactively. The last piece I have left is to detect incomplete...
1
by: balg | last post by:
How can I validate whether a given file is a .Net Assembly / Com-ActiveX binary / Other ? Is it possible without opening the file twice, or even once ?
2
by: marc.gibian | last post by:
I am writing a small program in C#/.NET that reads input files as they arrive from other processes. Therefore, it is perfectly reasonable for a file to be busy while it is being deposited for use...
2
by: Pete Davis | last post by:
I'm trying to figure out how to distinguish a CD drive from a DVD drive. I thought it would be as simple as using WMI, but the properties that would distinguish between the 2 don't seem to exist...
4
by: Peter Jaffe | last post by:
I've seen a few posts on this topic, but still haven't found a clean solution. Anyone have other suggestions or feel that one of the options I highlight below is the way to go? The Problem...
3
by: Suma | last post by:
Hi all, Is there any way from which we can find out if a window is opened as a modal window or as a normal window? I have a screen which opens as a normal window in one case and in other case...
8
by: Pietro | last post by:
Hi, i would like to know if there is a way to differentiate between requests, someting like a number that is unique only in the execution of an individual request. Thank you Pietro
2
by: nala | last post by:
Hi, I'm wondering how to check for whether a file exists inside a given directory. I'm currently using an ifstream class to do this by passing the name of the file and checking for a .fail...
5
by: Joe S | last post by:
I have been searching all over for how to use SendKeys to send Keys.RControlKey. I've tried all manner of byte conversions and just can't get it to work. Pity there is no {RCONTROL} defined...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.