Changeset 84876aa4 in mainline for uspace/srv/hid/input/input.c


Ignore:
Timestamp:
2019-11-15T13:46:34Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ecb7828
Parents:
b093a62 (diff), d548fc0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge master into gfx

Mainly to get XCW fixes

File:
1 edited

Legend:

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

    rb093a62 r84876aa4  
    6666#include "serial.h"
    6767
    68 #define NUM_LAYOUTS  4
     68#define NUM_LAYOUTS 5
    6969
    7070static layout_ops_t *layout[NUM_LAYOUTS] = {
     
    7272        &us_dvorak_ops,
    7373        &cz_ops,
    74         &ar_ops
     74        &ar_ops,
     75        &fr_azerty_ops
    7576};
    7677
     
    208209        // TODO: More elegant layout switching
    209210
    210         if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
    211             (key == KC_F1)) {
    212                 layout_destroy(kdev->active_layout);
    213                 kdev->active_layout = layout_create(layout[0]);
    214                 return;
    215         }
    216 
    217         if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
    218             (key == KC_F2)) {
    219                 layout_destroy(kdev->active_layout);
    220                 kdev->active_layout = layout_create(layout[1]);
    221                 return;
    222         }
    223 
    224         if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
    225             (key == KC_F3)) {
    226                 layout_destroy(kdev->active_layout);
    227                 kdev->active_layout = layout_create(layout[2]);
    228                 return;
    229         }
    230 
    231         if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
    232             (key == KC_F4)) {
    233                 layout_destroy(kdev->active_layout);
    234                 kdev->active_layout = layout_create(layout[3]);
    235                 return;
     211        if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL)) {
     212                switch (key) {
     213                case KC_F1:
     214                        layout_destroy(kdev->active_layout);
     215                        kdev->active_layout = layout_create(layout[0]);
     216                        break;
     217                case KC_F2:
     218                        layout_destroy(kdev->active_layout);
     219                        kdev->active_layout = layout_create(layout[1]);
     220                        break;
     221                case KC_F3:
     222                        layout_destroy(kdev->active_layout);
     223                        kdev->active_layout = layout_create(layout[2]);
     224                        break;
     225                case KC_F4:
     226                        layout_destroy(kdev->active_layout);
     227                        kdev->active_layout = layout_create(layout[3]);
     228                        break;
     229                case KC_F5:
     230                        layout_destroy(kdev->active_layout);
     231                        kdev->active_layout = layout_create(layout[4]);
     232                        break;
     233                default: // default: is here to avoid compiler warning about unhandled cases
     234                        break;
     235                }
    236236        }
    237237
Note: See TracChangeset for help on using the changeset viewer.