Questions tagged [modifier-key]

A modifier key is a special key (or combination) on a computer keyboard that temporarily modifies the normal action of another key when pressed together.

Per Modifier Key:

In computing, a modifier key is a special key (or combination) on a computer keyboard that temporarily modifies the normal action of another key when pressed together. By themselves, modifier keys usually do nothing; that is, pressing any of the Shift, Alt, or Ctrl keys alone does not (generally) trigger any action from the computer.

For example, in most keyboard layouts the Shift key combination ⇧ Shift+A will produce a capital letter "A" instead of the default lower-case letter "a" (unless in Caps lock or Shift lock mode). A combination of Alt+F4 in Microsoft Windows will close the program in the active window; in this instance, Alt is the modifier key. In contrast, pressing just ⇧ Shift or Alt will probably do nothing unless assigned a specific function in a particular program (for example, activating input aids or the toolbar of the active window in Windows).

61 questions
67
votes
5 answers

Detecting combination keypresses (Control, Alt, Shift)?

I am trying to make a script run when Ctrl + Alt + e is pressed. How can Tampermonkey fire on a simultaneous ctrl, alt, and e key? I have tried ctrlKey, and altKey. I've found nothing that works. How can I edit the script below to fire on Ctrl +…
Rasspy
  • 673
  • 1
  • 5
  • 5
40
votes
1 answer

Accessing Keys from Linux Input Device

What I am trying to do So, I have been trying to access keyboard input in Linux. Specifically, I need to be able to access modifier key presses without other keys being pressed. Furthermore, I want to be able to do this without an X system…
Senkwich
  • 1,022
  • 1
  • 9
  • 17
29
votes
3 answers

How can I check if a keyboard modifier is pressed (Shift, Ctrl, or Alt)?

I am building a UI with Qt Creator and I want buttons to perform different actions with different modifiers. So I thought I could call functions with dynamic string properties that would perform the action depending on the modifier. Is there a…
user1087058
  • 349
  • 1
  • 3
  • 5
28
votes
9 answers

How to use multiple modifier keys in C#

I am using a keydown event to detect keys pressed and have several key combinations for various operations. if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control && e.Modifiers == Keys.Shift) { //Do work } else if (e.KeyCode == Keys.V &&…
jsmith
  • 7,198
  • 6
  • 42
  • 59
22
votes
4 answers

Check modifierFlags of NSEvent if a certain modifier was pressed but no other

I just experimented with the addLocalMonitorForEventsMatchingMask:handler: method in NSEvent and came across the following question: How do I find out if only certain modifiers were pressed? A short example to set this question into context: I…
Florian Pilz
  • 8,002
  • 4
  • 22
  • 30
10
votes
5 answers

AutoHotkey causing control key to get stuck

I have several situations when my control key gets stuck, and it happens only when I have AutoHotkey running. This happens with multiple different modifier keys including the control (^), windows (#), and alt (!) keys. Similar problems have been…
Stenemo
  • 611
  • 7
  • 13
9
votes
4 answers

What would it take to add new modifier keys to Windows?

From what I can tell, the notion of "Shift", "Alt", and "Control" are pretty well hard coded from the keyboard itself right through the OS APIs. Sometimes I see the Windows key used as a modifier, but it doesn't seem to register as a "real"…
CodexArcanum
  • 3,944
  • 3
  • 35
  • 40
9
votes
2 answers

matplotlib: How to pick up shift click on figure?

I have a matplotlib and I have created a button_press_event like this: self.fig.canvas.mpl_connect('button_press_event', self.onClick) def onClick(self, event) if event.button == 1: # draw some artists on left click elif…
NotNone
  • 661
  • 1
  • 8
  • 13
8
votes
1 answer

How to remap (control) modifier key in vim?

I avoid the "control" key, AKA in vim parlance, on my laptop; I hate where Apple put it. I would really like to remap all of the vim commands using control to instead use "command", but this does not seem possible on a Mac, despite what I have…
David Rivers
  • 2,896
  • 1
  • 31
  • 39
6
votes
1 answer

All WPF context menus do not seem to handle highlighting items properly when a modifier key is held down

It happens in all my WPF applications and Visual Studio 2019 (which is definitely WPF based) also exhibits this strange behavior: Simply right click an item in the solution explorer while holding, say, the Control key and you should notice that the…
Jelly Ama
  • 6,701
  • 3
  • 20
  • 23
5
votes
2 answers

NSEvent: test for only one modfierkey

Ok, I understand how to determine from an NSEvent if a modifierkey is pressed : if ([theEvent modifierFlags] & NSAlternateKeyMask) { // The Option/Alt key was pressed } But this also captures the optionkey and another modifierkey at the…
koen
  • 5,383
  • 7
  • 50
  • 89
5
votes
1 answer

detect/get notification if shift key (modifier-key) pressed in uitextview

I'm trying to figure out if there is any way in which we can detect if shift key is pressed or if any notification is sent when shift key is pressed in UIKeyboard - (BOOL) textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range…
dips
  • 227
  • 2
  • 12
5
votes
1 answer

How to query keyboard modifiers in QML?

Qt offers this with QGuiApplication::keyboardModifiers(). What is the QML way?
ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103
5
votes
2 answers

theEvent charactersIgnoringModifiers - Get characters without modifiers

Im trying to implement a keyboard class in my game that has two modes. The game mode takes input that uses lowercase, unmodified keys (unmodified meaning if I type a '0' with the shift it still returns '0' instead of ')'). I have tracked it down as…
Chase Walden
  • 1,252
  • 1
  • 14
  • 31
4
votes
1 answer

c++ - SendInput() doesn't manage Alt codes properly

On a program that I'm developing I have to simulate keystrokes, and to do so I use the SendInput() method, passing as argument a vector containing the inputs which are part of the keystroke. My current code seems to work properly with all the…
DiHase
  • 43
  • 5
1
2 3 4 5