How to detect the modifier key on mouse click
On Qt 4, try QApplication::keyboardModifiers(). The Qt 5 and Qt 6 equivalent is QGuiApplication::keyboardModifiers().
On Qt 4, try QApplication::keyboardModifiers(). The Qt 5 and Qt 6 equivalent is QGuiApplication::keyboardModifiers().
Open the input device, #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <linux/input.h> #include <string.h> #include <stdio.h> static const char *const evval[3] = { “RELEASED”, “PRESSED “, “REPEATED” }; int main(void) { const char *dev = “/dev/input/by-path/platform-i8042-serio-0-event-kbd”; struct input_event ev; ssize_t n; int fd; fd = open(dev, O_RDONLY); if (fd == -1) { fprintf(stderr, … 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