KeyDown : recognizing multiple keys
You can check the modifiers of the KeyEventArgs like so: private void listView1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up && e.Modifiers == Keys.Control) { //do stuff } } MSDN reference
You can check the modifiers of the KeyEventArgs like so: private void listView1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up && e.Modifiers == Keys.Control) { //do stuff } } MSDN reference
I found a solution. Set IsDocumentEnabled to “True” and set IsReadOnly to “True”. <RichTextBox IsReadOnly=”True” IsDocumentEnabled=”True” /> Once I did this, the mouse would turn into a ‘hand’ when I hover over a text displayed within a HyperLink tag. Clicking without holding control will fire the ‘Click’ event. I am using WPF from .NET 4. … Read more
Refer to the W3C spec for keyboard events. Several boolean attributes are provided to determine if modifier keys were pressed in conjunction with whatever target key you are interested in. They are: ctrlKey — The “Control” key was also pressed. shiftKey — The “Shift” key was also pressed. altKey … Read more
Use onkeydown (or onkeyup), not onkeypress Use keyCode 90, not 122 function KeyPress(e) { var evtobj = window.event? event : e if (evtobj.keyCode == 90 && evtobj.ctrlKey) alert(“Ctrl+z”); } document.onkeydown = KeyPress; Online demo: http://jsfiddle.net/29sVC/ To clarify, keycodes are not the same as character codes. Character codes are for text (they differ depending on the … Read more