Changeset f9edc7b in mainline


Ignore:
Timestamp:
2019-05-18T06:42:01Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
a8171b86
Parents:
95f603c
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-05-16 09:46:12)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-05-18 06:42:01)
Message:

Keyboard layouts can now identify itself

The structure layout_ops_t has been extended with the
parameter get_name() which returns the name of the kb layout

Location:
uspace/srv/hid/input
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/layout.h

    r95f603c rf9edc7b  
    5454        void (*destroy)(layout_t *);
    5555        wchar_t (*parse_ev)(layout_t *, kbd_event_t *);
     56        const char *(*get_name)(void);
    5657} layout_ops_t;
    5758
  • uspace/srv/hid/input/layout/ar.c

    r95f603c rf9edc7b  
    4949static void ar_destroy(layout_t *);
    5050static wchar_t ar_parse_ev(layout_t *, kbd_event_t *ev);
     51static const char *ar_name(void);
    5152
    5253static const layout_ops_t layout_intern = {
    5354        .create = ar_create,
    5455        .destroy = ar_destroy,
    55         .parse_ev = ar_parse_ev
     56        .parse_ev = ar_parse_ev,
     57        .get_name = ar_name
    5658};
    5759
     
    6668layout_ops_t layout_active = layout_intern;
    6769#endif
     70
     71static const char *ar_name(void)
     72{
     73        return "ar";
     74}
    6875
    6976static wchar_t map_not_shifted[] = {
  • uspace/srv/hid/input/layout/cz.c

    r95f603c rf9edc7b  
    5050static void cz_destroy(layout_t *);
    5151static wchar_t cz_parse_ev(layout_t *, kbd_event_t *ev);
     52static const char *cz_name(void);
    5253
    5354static const layout_ops_t layout_intern = {
    5455        .create = cz_create,
    5556        .destroy = cz_destroy,
    56         .parse_ev = cz_parse_ev
     57        .parse_ev = cz_parse_ev,
     58        .get_name = cz_name
    5759};
    5860
     
    6769layout_ops_t layout_active = layout_intern;
    6870#endif
     71
     72static const char *cz_name(void)
     73{
     74        return "cz";
     75}
    6976
    7077enum m_state {
  • uspace/srv/hid/input/layout/us_dvorak.c

    r95f603c rf9edc7b  
    4848static void us_dvorak_destroy(layout_t *);
    4949static wchar_t us_dvorak_parse_ev(layout_t *, kbd_event_t *ev);
     50static const char *us_dvorak_name(void);
    5051
    5152static const layout_ops_t layout_intern = {
    5253        .create = us_dvorak_create,
    5354        .destroy = us_dvorak_destroy,
    54         .parse_ev = us_dvorak_parse_ev
     55        .parse_ev = us_dvorak_parse_ev,
     56        .get_name = us_dvorak_name
    5557};
    5658
     
    6567layout_ops_t layout_active = layout_intern;
    6668#endif
     69
     70static const char *us_dvorak_name(void)
     71{
     72        return "us_dvorak";
     73}
    6774
    6875static wchar_t map_lcase[] = {
  • uspace/srv/hid/input/layout/us_qwerty.c

    r95f603c rf9edc7b  
    4848static void us_qwerty_destroy(layout_t *);
    4949static wchar_t us_qwerty_parse_ev(layout_t *, kbd_event_t *ev);
     50static const char *us_qwerty_name(void);
    5051
    5152static const layout_ops_t layout_intern = {
    5253        .create = us_qwerty_create,
    5354        .destroy = us_qwerty_destroy,
    54         .parse_ev = us_qwerty_parse_ev
     55        .parse_ev = us_qwerty_parse_ev,
     56        .get_name = us_qwerty_name
    5557};
    5658
     
    6567layout_ops_t layout_active = layout_intern;
    6668#endif
     69
     70
     71static const char *us_qwerty_name(void)
     72{
     73        return "us_qwerty";
     74}
    6775
    6876static wchar_t map_lcase[] = {
Note: See TracChangeset for help on using the changeset viewer.