qt: Add Alt+PrtSc special case for one evdev key

This commit is contained in:
RichardG867
2023-04-09 19:49:25 -03:00
parent fb00a89b89
commit 8fc6027756
2 changed files with 11 additions and 1 deletions

View File

@@ -69,6 +69,7 @@ static std::unordered_map<uint32_t, uint16_t> evdev_keycodes = {
/* Multimedia keys. Guideline is to try and follow the Microsoft standard, then
fill in remaining scancodes with OEM-specific keys for redundancy sake. Keys
marked with # are not translated into evdev codes by the standard atkbd driver. */
{634, 0x54}, /* SELECTIVE_SCREENSHOT# => Alt+SysRq */
{117, 0x59}, /* KPEQUAL */
{418, 0x6a}, /* ZOOMIN# => Logitech */
{420, 0x6b}, /* ZOOMRESET# => Logitech */
@@ -107,7 +108,6 @@ static std::unordered_map<uint32_t, uint16_t> evdev_keycodes = {
{115, 0x130}, /* VOL+ */
{150, 0x132}, /* WWW# */
{172, 0x132}, /* HOMEPAGE */
{634, 0x137}, /* SELECTIVE_SCREENSHOT# => SysRq */
{138, 0x13b}, /* HELP# */
{213, 0x13c}, /* SOUND# => My Music/Office Home */
{360, 0x13c}, /* VENDOR# => My Music/Office Home */

View File

@@ -931,6 +931,16 @@ MainWindow::processKeyboardInput(bool down, uint32_t keycode)
/* Apply special cases. */
switch (keycode) {
case 0x54: /* Alt + Print Screen (special case, i.e. evdev SELECTIVE_SCREENSHOT) */
/* Send Alt as well. */
if (down) {
keyboard_input(down, 0x38);
} else {
keyboard_input(down, keycode);
keycode = 0x38;
}
break;
case 0x11d: /* Right Ctrl */
if (rctrl_is_lalt)
keycode = 0x38; /* map to Left Alt */