Changeset 49aaa0e in mainline


Ignore:
Timestamp:
2024-06-22T10:54:41Z (4 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
4b20d5f, 6a044dd, a894219
Parents:
ec50d65e
Message:

Switch virtual consoles using Alt-Fn or Shift-Fn

Shift-Fn is useful because Alt-Fn is usually taken by desktop
environment when running in an emulator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/console/console.c

    rec50d65e r49aaa0e  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * Copyright (c) 2011 Martin Decky
    44 * All rights reserved.
     
    366366{
    367367        cons_event_t event;
    368 
     368        bool alt;
     369        bool shift;
     370
     371        alt = (mods & KM_ALT) != 0 && (mods & (KM_CTRL | KM_SHIFT)) == 0;
     372        shift = (mods & KM_SHIFT) != 0 && (mods & (KM_CTRL | KM_ALT)) == 0;
     373
     374        /* Switch console on Alt+Fn or Shift+Fn */
    369375        if ((key >= KC_F1) && (key <= KC_F1 + CONSOLE_COUNT) &&
    370             ((mods & KM_CTRL) == 0)) {
     376            (alt || shift)) {
    371377                cons_switch(key - KC_F1);
    372378        } else {
Note: See TracChangeset for help on using the changeset viewer.