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
4
votes
1 answer

emacs create key modifier

I am using emacs on mac os. I would like to map a modifier (Meta, Control,...) to a simple key. Basically this is what I need : (global-set-key (kbd "a") 'hyper) Here a is just the a key, no Control-a or whatever, just "a" alone whithout…
itsu
  • 222
  • 1
  • 10
4
votes
4 answers

How to tell when modifier keys are pressed/released

I want to be able to tell when a modified key (Ctrl or Shift) is pressed or released. Basically, users can perform multiple keystrokes with a modifier key pressed and I don't want to perform an action until after it is released (think Emacs with…
KrisTrip
  • 4,943
  • 12
  • 55
  • 74
3
votes
1 answer

JavaFX Events for Mouse Interactions are not triggered if Key is pressed

JavaFX does not execute events like the ActionEvent for Button or CheckBox, if a modifier key like CTRL or SHIFT is pressed. As far as I understand this behavior is implemented in ButtonBehavior (e.g. note the expression ! keyDown in the following…
Till F.
  • 189
  • 1
  • 9
3
votes
1 answer

Detect Windows-like or Mac-like keyboard in Javascript

My web app has a feature where the user can hold Ctrl (Windows, ctrlKey) or Cmd (Mac, metaKey). I want to provide help text telling the user they can do this. What's a reliable way to detect a Mac-like keyboard? Is navigator.platform.match(/mac/i)…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
3
votes
2 answers

Determine Linux keyboard events device

This other question, Accessing Keys from Linux Input Device provided working C code on how to recognize a modifier key press in the Linux text console when no other keys are being pressed. However, to apply the trick you have to know the specific…
frank99
  • 39
  • 1
  • 2
3
votes
3 answers

Qt: Detect Double-Click with Modkey (Shift, CTRL, etc.)

How can I detect whether a double click on a QWidget (QStatusBar, in my case) occured while a modifier key was held down? I can overload void QWidget::mouseDoubleClickEvent ( QMouseEvent * event ) to get the double click, but how can I sure whether…
fawick
  • 590
  • 5
  • 20
3
votes
1 answer

How do I get a char obtained by holding shift?

I'll try to explain better what I mean, and I'll also try to keep the question free from language, though if there is a way to do what I want in C# without having to reference anything it'd be nice. Anyway. I am handling keyboard input, and…
KappaG3
  • 660
  • 5
  • 14
3
votes
2 answers

How to hold the Ctrl key down through code

I'm writing a unit test and a certain function will be called deep down in the stack if (Control.ModifierKeys == Keys.Control).. I can add a flag or something for the particular case of running a unit test, but it would be too dirty! How can I set…
DeveloperInToronto
  • 1,173
  • 2
  • 14
  • 32
2
votes
4 answers

Using Numpad with Modifier Keys exhibits curious behavior

I have a keyboard event listener, and I am listening for the number pad key codes (1 through 9) for when number lock is activated; this works fine. However, in my app I also want to allow usage of a modifier key (CTRL) along with the number pad…
Not Sure
  • 5,873
  • 3
  • 23
  • 29
2
votes
1 answer

Proper way to detect when Ctrl (or other modifier key) is pressed

I want to condition an action on whether or not a modifier key (Ctrl) is pressed. One workaround I have found is to install an event filter and use QApplication.queryKeyboardModifiers() to detect when Ctrl is pressed, and…
amateur3057
  • 345
  • 1
  • 2
  • 11
2
votes
1 answer

get state of modifier keys (orange, blue, shift) on MC91 and MC92

We develop an application which runs full screen so the modifier indicators are not visible. So I now need a solution to update icons we put on the display with the state of orange, blue and shift. The fun part is this solution should work on Omnii…
2
votes
1 answer

Userscript for creating a confirmation popup whenever pressing Ctrl+Enter or Enter in the title textbox of a new issue page in GitHub

(In continuance of this answer) I've been trying to make a script (using Greasemonkey) that would show a confirmation popup whenever I attempt to: submit a new issue, or post a new comment. via pressing Ctrl + Enter: if user presses Ok in the…
darkred
  • 591
  • 5
  • 28
2
votes
0 answers

read arrow and other special keys in C, without ncurses

I have a new problem I came across: I want to create a shell for Linux, but I don't know, how to read special input keys like arrow key, CTRL-key or F11 key, without using ncurses. I can't use ncurses, since I want to print the STDOUT and STDERR.…
Poehli
  • 307
  • 4
  • 16
2
votes
1 answer

Mapping caps lock in vim only?

I'd really like to be able to map the caps lock key to Ctrl, but only in vim. I saw this, but I'm using OS X. Is there an OS X alternative to AutoHotKey, or is there another way to create an application-specific mapping for a modifier key?
Adam Incera
  • 117
  • 1
  • 5
2
votes
0 answers

Fish 'bind' with Ctrl+Alt and ArrowUp

On a Fish 2.0.0 shell I want to bind Ctrl+Alt+ArrowUp with some command. But I can't seem to figure out how to do it: bind \c\earrow-up 'touch /tmp/it_worked' I believe I have two problems, one the combination between Ctrl and Alt and the other that…
harm
  • 10,045
  • 10
  • 36
  • 41