Changeset 28a5ebd in mainline for uspace/srv/hid/input


Ignore:
Timestamp:
2020-06-18T15:39:50Z (5 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce52c333
Parents:
4f663f3e
Message:

Use char32_t instead of wchat_t to represent UTF-32 strings

The intention of the native HelenOS string API has been always to
support Unicode in the UTF-8 and UTF-32 encodings as the sole character
representations and ignore the obsolete mess of older single-byte and
multibyte character encodings. Before C11, the wchar_t type has been
slightly misused for the purpose of the UTF-32 strings. The newer
char32_t type is obviously a much more suitable option. The standard
defines char32_t as uint_least32_t, thus we can take the liberty to fix
it to uint32_t.

To maintain compatilibity with the C Standard, the putwchar(wchar_t)
functions has been replaced by our custom putuchar(char32_t) functions
where appropriate.

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

Legend:

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

    r4f663f3e r28a5ebd  
    6969
    7070/** Parse keyboard event. */
    71 wchar_t layout_parse_ev(layout_t *layout, kbd_event_t *ev)
     71char32_t layout_parse_ev(layout_t *layout, kbd_event_t *ev)
    7272{
    7373        return (*layout->ops->parse_ev)(layout, ev);
  • uspace/srv/hid/input/layout.h

    r4f663f3e r28a5ebd  
    5353        errno_t (*create)(layout_t *);
    5454        void (*destroy)(layout_t *);
    55         wchar_t (*parse_ev)(layout_t *, kbd_event_t *);
     55        char32_t (*parse_ev)(layout_t *, kbd_event_t *);
    5656} layout_ops_t;
    5757
     
    6464extern layout_t *layout_create(layout_ops_t *);
    6565extern void layout_destroy(layout_t *);
    66 extern wchar_t layout_parse_ev(layout_t *, kbd_event_t *);
     66extern char32_t layout_parse_ev(layout_t *, kbd_event_t *);
    6767
    6868#endif
  • uspace/srv/hid/input/layout/ar.c

    r4f663f3e r28a5ebd  
    4444static errno_t ar_create(layout_t *);
    4545static void ar_destroy(layout_t *);
    46 static wchar_t ar_parse_ev(layout_t *, kbd_event_t *ev);
     46static char32_t ar_parse_ev(layout_t *, kbd_event_t *ev);
    4747
    4848layout_ops_t ar_ops = {
     
    5252};
    5353
    54 static wchar_t map_not_shifted[] = {
     54static char32_t map_not_shifted[] = {
    5555        [KC_BACKTICK] = L'ذ',
    5656
     
    110110};
    111111
    112 static wchar_t map_shifted[] = {
     112static char32_t map_shifted[] = {
    113113        [KC_BACKTICK] = L'ّ',
    114114
     
    168168};
    169169
    170 static wchar_t map_neutral[] = {
     170static char32_t map_neutral[] = {
    171171        [KC_BACKSPACE] = '\b',
    172172        [KC_TAB] = '\t',
     
    181181};
    182182
    183 static wchar_t map_numeric[] = {
     183static char32_t map_numeric[] = {
    184184        [KC_N7] = '7',
    185185        [KC_N8] = '8',
     
    196196};
    197197
    198 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length)
     198static char32_t translate(unsigned int key, char32_t *map, size_t map_length)
    199199{
    200200        if (key >= map_length)
     
    212212}
    213213
    214 static wchar_t ar_parse_ev(layout_t *state, kbd_event_t *ev)
    215 {
    216         wchar_t c;
     214static char32_t ar_parse_ev(layout_t *state, kbd_event_t *ev)
     215{
     216        char32_t c;
    217217
    218218        /* Produce no characters when Ctrl or Alt is pressed. */
     
    220220                return 0;
    221221
    222         c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t));
     222        c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char32_t));
    223223        if (c != 0)
    224224                return c;
    225225
    226226        if ((ev->mods & KM_SHIFT) != 0)
    227                 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t));
     227                c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char32_t));
    228228        else
    229                 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t));
     229                c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char32_t));
    230230
    231231        if (c != 0)
     
    233233
    234234        if ((ev->mods & KM_NUM_LOCK) != 0)
    235                 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t));
     235                c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char32_t));
    236236        else
    237237                c = 0;
  • uspace/srv/hid/input/layout/cz.c

    r4f663f3e r28a5ebd  
    4545static errno_t cz_create(layout_t *);
    4646static void cz_destroy(layout_t *);
    47 static wchar_t cz_parse_ev(layout_t *, kbd_event_t *ev);
     47static char32_t cz_parse_ev(layout_t *, kbd_event_t *ev);
    4848
    4949enum m_state {
     
    6363};
    6464
    65 static wchar_t map_lcase[] = {
     65static char32_t map_lcase[] = {
    6666        [KC_Q] = 'q',
    6767        [KC_W] = 'w',
     
    9494};
    9595
    96 static wchar_t map_ucase[] = {
     96static char32_t map_ucase[] = {
    9797        [KC_Q] = 'Q',
    9898        [KC_W] = 'W',
     
    125125};
    126126
    127 static wchar_t map_not_shifted[] = {
     127static char32_t map_not_shifted[] = {
    128128        [KC_BACKTICK] = ';',
    129129
     
    141141};
    142142
    143 static wchar_t map_shifted[] = {
     143static char32_t map_shifted[] = {
    144144        [KC_1] = '1',
    145145        [KC_2] = '2',
     
    167167};
    168168
    169 static wchar_t map_ns_nocaps[] = {
     169static char32_t map_ns_nocaps[] = {
    170170        [KC_2] = L'ě',
    171171        [KC_3] = L'š',
     
    182182};
    183183
    184 static wchar_t map_ns_caps[] = {
     184static char32_t map_ns_caps[] = {
    185185        [KC_2] = L'Ě',
    186186        [KC_3] = L'Š',
     
    197197};
    198198
    199 static wchar_t map_neutral[] = {
     199static char32_t map_neutral[] = {
    200200        [KC_BACKSPACE] = '\b',
    201201        [KC_TAB] = '\t',
     
    210210};
    211211
    212 static wchar_t map_numeric[] = {
     212static char32_t map_numeric[] = {
    213213        [KC_N7] = '7',
    214214        [KC_N8] = '8',
     
    225225};
    226226
    227 static wchar_t map_hacek_lcase[] = {
     227static char32_t map_hacek_lcase[] = {
    228228        [KC_E] = L'ě',
    229229        [KC_R] = L'ř',
     
    239239};
    240240
    241 static wchar_t map_hacek_ucase[] = {
     241static char32_t map_hacek_ucase[] = {
    242242        [KC_E] = L'Ě',
    243243        [KC_R] = L'Ř',
     
    253253};
    254254
    255 static wchar_t map_carka_lcase[] = {
     255static char32_t map_carka_lcase[] = {
    256256        [KC_E] = L'é',
    257257        [KC_U] = L'ú',
     
    264264};
    265265
    266 static wchar_t map_carka_ucase[] = {
     266static char32_t map_carka_ucase[] = {
    267267        [KC_E] = L'É',
    268268        [KC_U] = L'Ú',
     
    275275};
    276276
    277 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length)
     277static char32_t translate(unsigned int key, char32_t *map, size_t map_length)
    278278{
    279279        if (key >= map_length)
     
    282282}
    283283
    284 static wchar_t parse_ms_hacek(layout_cz_t *cz_state, kbd_event_t *ev)
    285 {
    286         wchar_t c;
     284static char32_t parse_ms_hacek(layout_cz_t *cz_state, kbd_event_t *ev)
     285{
     286        char32_t c;
    287287
    288288        cz_state->mstate = ms_start;
     
    293293
    294294        if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0))
    295                 c = translate(ev->key, map_hacek_ucase, sizeof(map_hacek_ucase) / sizeof(wchar_t));
     295                c = translate(ev->key, map_hacek_ucase, sizeof(map_hacek_ucase) / sizeof(char32_t));
    296296        else
    297                 c = translate(ev->key, map_hacek_lcase, sizeof(map_hacek_lcase) / sizeof(wchar_t));
     297                c = translate(ev->key, map_hacek_lcase, sizeof(map_hacek_lcase) / sizeof(char32_t));
    298298
    299299        return c;
    300300}
    301301
    302 static wchar_t parse_ms_carka(layout_cz_t *cz_state, kbd_event_t *ev)
    303 {
    304         wchar_t c;
     302static char32_t parse_ms_carka(layout_cz_t *cz_state, kbd_event_t *ev)
     303{
     304        char32_t c;
    305305
    306306        cz_state->mstate = ms_start;
     
    311311
    312312        if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0))
    313                 c = translate(ev->key, map_carka_ucase, sizeof(map_carka_ucase) / sizeof(wchar_t));
     313                c = translate(ev->key, map_carka_ucase, sizeof(map_carka_ucase) / sizeof(char32_t));
    314314        else
    315                 c = translate(ev->key, map_carka_lcase, sizeof(map_carka_lcase) / sizeof(wchar_t));
     315                c = translate(ev->key, map_carka_lcase, sizeof(map_carka_lcase) / sizeof(char32_t));
    316316
    317317        return c;
    318318}
    319319
    320 static wchar_t parse_ms_start(layout_cz_t *cz_state, kbd_event_t *ev)
    321 {
    322         wchar_t c;
     320static char32_t parse_ms_start(layout_cz_t *cz_state, kbd_event_t *ev)
     321{
     322        char32_t c;
    323323
    324324        /* Produce no characters when Ctrl or Alt is pressed. */
     
    335335        }
    336336
    337         c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t));
     337        c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char32_t));
    338338        if (c != 0)
    339339                return c;
     
    341341        if ((ev->mods & KM_SHIFT) == 0) {
    342342                if ((ev->mods & KM_CAPS_LOCK) != 0)
    343                         c = translate(ev->key, map_ns_caps, sizeof(map_ns_caps) / sizeof(wchar_t));
     343                        c = translate(ev->key, map_ns_caps, sizeof(map_ns_caps) / sizeof(char32_t));
    344344                else
    345                         c = translate(ev->key, map_ns_nocaps, sizeof(map_ns_nocaps) / sizeof(wchar_t));
     345                        c = translate(ev->key, map_ns_nocaps, sizeof(map_ns_nocaps) / sizeof(char32_t));
    346346
    347347                if (c != 0)
     
    350350
    351351        if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0))
    352                 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t));
     352                c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(char32_t));
    353353        else
    354                 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t));
     354                c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(char32_t));
    355355
    356356        if (c != 0)
     
    358358
    359359        if ((ev->mods & KM_SHIFT) != 0)
    360                 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t));
     360                c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char32_t));
    361361        else
    362                 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t));
     362                c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char32_t));
    363363
    364364        if (c != 0)
     
    366366
    367367        if ((ev->mods & KM_NUM_LOCK) != 0)
    368                 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t));
     368                c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char32_t));
    369369        else
    370370                c = 0;
     
    409409}
    410410
    411 static wchar_t cz_parse_ev(layout_t *state, kbd_event_t *ev)
     411static char32_t cz_parse_ev(layout_t *state, kbd_event_t *ev)
    412412{
    413413        layout_cz_t *cz_state = (layout_cz_t *) state->layout_priv;
  • uspace/srv/hid/input/layout/fr_azerty.c

    r4f663f3e r28a5ebd  
    4343static errno_t fr_azerty_create (layout_t *);
    4444static void fr_azerty_destroy (layout_t *);
    45 static wchar_t fr_azerty_parse_ev (layout_t *, kbd_event_t *);
     45static char32_t fr_azerty_parse_ev (layout_t *, kbd_event_t *);
    4646
    4747layout_ops_t fr_azerty_ops = {
     
    5151};
    5252
    53 static wchar_t map_lcase[] = {
     53static char32_t map_lcase[] = {
    5454        [KC_Q] = 'a',
    5555        [KC_W] = 'z',
     
    8282};
    8383
    84 static wchar_t map_ucase[] = {
     84static char32_t map_ucase[] = {
    8585        [KC_Q] = 'A',
    8686        [KC_W] = 'Z',
     
    117117};
    118118
    119 static wchar_t map_not_shifted[] = {
     119static char32_t map_not_shifted[] = {
    120120        [KC_BACKTICK] = L'²',
    121121
     
    146146};
    147147
    148 static wchar_t map_shifted[] = {
     148static char32_t map_shifted[] = {
    149149        [KC_M] = '?',
    150150        [KC_BACKTICK] = '~',
     
    176176};
    177177
    178 static wchar_t map_neutral[] = {
     178static char32_t map_neutral[] = {
    179179        [KC_BACKSPACE] = '\b',
    180180        [KC_TAB] = '\t',
     
    189189};
    190190
    191 static wchar_t map_numeric[] = {
     191static char32_t map_numeric[] = {
    192192        [KC_N7] = '7',
    193193        [KC_N8] = '8',
     
    204204};
    205205
    206 static wchar_t translate (unsigned int key, wchar_t *map, size_t map_len)
     206static char32_t translate (unsigned int key, char32_t *map, size_t map_len)
    207207{
    208208        if (key >= map_len)
     
    221221}
    222222
    223 static wchar_t fr_azerty_parse_ev (layout_t *s, kbd_event_t *e)
     223static char32_t fr_azerty_parse_ev (layout_t *s, kbd_event_t *e)
    224224{
    225225        if ((e->mods & (KM_CTRL | KM_ALT)))
    226226                return 0; // Produce no characters when Ctrl or Alt is pressed
    227227
    228         wchar_t c = translate (e->key, map_neutral, sizeof (map_neutral) / sizeof (wchar_t));
     228        char32_t c = translate (e->key, map_neutral, sizeof (map_neutral) / sizeof (char32_t));
    229229        if (c)
    230230                return c;
    231231
    232232        if ((e->mods & KM_SHIFT))
    233                 c = translate (e->key, map_shifted, sizeof (map_shifted) / sizeof (wchar_t));
     233                c = translate (e->key, map_shifted, sizeof (map_shifted) / sizeof (char32_t));
    234234        else
    235                 c = translate (e->key, map_not_shifted, sizeof (map_not_shifted) / sizeof (wchar_t));
     235                c = translate (e->key, map_not_shifted, sizeof (map_not_shifted) / sizeof (char32_t));
    236236
    237237        if (c)
     
    239239
    240240        if (((e->mods & KM_SHIFT)) ^ ((e->mods & KM_CAPS_LOCK)))
    241                 c = translate (e->key, map_ucase, sizeof (map_ucase) / sizeof (wchar_t));
     241                c = translate (e->key, map_ucase, sizeof (map_ucase) / sizeof (char32_t));
    242242        else
    243                 c = translate (e->key, map_lcase, sizeof (map_lcase) / sizeof (wchar_t));
     243                c = translate (e->key, map_lcase, sizeof (map_lcase) / sizeof (char32_t));
    244244
    245245        if (c)
     
    247247
    248248        if ((e->mods & KM_NUM_LOCK))
    249                 c = translate (e->key, map_numeric, sizeof (map_numeric) / sizeof (wchar_t));
     249                c = translate (e->key, map_numeric, sizeof (map_numeric) / sizeof (char32_t));
    250250        else
    251251                c = 0;
  • uspace/srv/hid/input/layout/us_dvorak.c

    r4f663f3e r28a5ebd  
    4343static errno_t us_dvorak_create(layout_t *);
    4444static void us_dvorak_destroy(layout_t *);
    45 static wchar_t us_dvorak_parse_ev(layout_t *, kbd_event_t *ev);
     45static char32_t us_dvorak_parse_ev(layout_t *, kbd_event_t *ev);
    4646
    4747layout_ops_t us_dvorak_ops = {
     
    5151};
    5252
    53 static wchar_t map_lcase[] = {
     53static char32_t map_lcase[] = {
    5454        [KC_R] = 'p',
    5555        [KC_T] = 'y',
     
    8484};
    8585
    86 static wchar_t map_ucase[] = {
     86static char32_t map_ucase[] = {
    8787        [KC_R] = 'P',
    8888        [KC_T] = 'Y',
     
    117117};
    118118
    119 static wchar_t map_not_shifted[] = {
     119static char32_t map_not_shifted[] = {
    120120        [KC_BACKTICK] = '`',
    121121
     
    147147};
    148148
    149 static wchar_t map_shifted[] = {
     149static char32_t map_shifted[] = {
    150150        [KC_BACKTICK] = '~',
    151151
     
    177177};
    178178
    179 static wchar_t map_neutral[] = {
     179static char32_t map_neutral[] = {
    180180        [KC_BACKSPACE] = '\b',
    181181        [KC_TAB] = '\t',
     
    190190};
    191191
    192 static wchar_t map_numeric[] = {
     192static char32_t map_numeric[] = {
    193193        [KC_N7] = '7',
    194194        [KC_N8] = '8',
     
    205205};
    206206
    207 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length)
     207static char32_t translate(unsigned int key, char32_t *map, size_t map_length)
    208208{
    209209        if (key >= map_length)
     
    221221}
    222222
    223 static wchar_t us_dvorak_parse_ev(layout_t *state, kbd_event_t *ev)
    224 {
    225         wchar_t c;
     223static char32_t us_dvorak_parse_ev(layout_t *state, kbd_event_t *ev)
     224{
     225        char32_t c;
    226226
    227227        /* Produce no characters when Ctrl or Alt is pressed. */
     
    229229                return 0;
    230230
    231         c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t));
     231        c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char32_t));
    232232        if (c != 0)
    233233                return c;
    234234
    235235        if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0))
    236                 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t));
     236                c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(char32_t));
    237237        else
    238                 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t));
     238                c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(char32_t));
    239239
    240240        if (c != 0)
     
    242242
    243243        if ((ev->mods & KM_SHIFT) != 0)
    244                 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t));
     244                c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char32_t));
    245245        else
    246                 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t));
     246                c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char32_t));
    247247
    248248        if (c != 0)
     
    250250
    251251        if ((ev->mods & KM_NUM_LOCK) != 0)
    252                 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t));
     252                c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char32_t));
    253253        else
    254254                c = 0;
  • uspace/srv/hid/input/layout/us_qwerty.c

    r4f663f3e r28a5ebd  
    4343static errno_t us_qwerty_create(layout_t *);
    4444static void us_qwerty_destroy(layout_t *);
    45 static wchar_t us_qwerty_parse_ev(layout_t *, kbd_event_t *ev);
     45static char32_t us_qwerty_parse_ev(layout_t *, kbd_event_t *ev);
    4646
    4747layout_ops_t us_qwerty_ops = {
     
    5151};
    5252
    53 static wchar_t map_lcase[] = {
     53static char32_t map_lcase[] = {
    5454        [KC_Q] = 'q',
    5555        [KC_W] = 'w',
     
    8282};
    8383
    84 static wchar_t map_ucase[] = {
     84static char32_t map_ucase[] = {
    8585        [KC_Q] = 'Q',
    8686        [KC_W] = 'W',
     
    113113};
    114114
    115 static wchar_t map_not_shifted[] = {
     115static char32_t map_not_shifted[] = {
    116116        [KC_BACKTICK] = '`',
    117117
     
    142142};
    143143
    144 static wchar_t map_shifted[] = {
     144static char32_t map_shifted[] = {
    145145        [KC_BACKTICK] = '~',
    146146
     
    171171};
    172172
    173 static wchar_t map_neutral[] = {
     173static char32_t map_neutral[] = {
    174174        [KC_BACKSPACE] = '\b',
    175175        [KC_TAB] = '\t',
     
    184184};
    185185
    186 static wchar_t map_numeric[] = {
     186static char32_t map_numeric[] = {
    187187        [KC_N7] = '7',
    188188        [KC_N8] = '8',
     
    199199};
    200200
    201 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length)
     201static char32_t translate(unsigned int key, char32_t *map, size_t map_length)
    202202{
    203203        if (key >= map_length)
     
    215215}
    216216
    217 static wchar_t us_qwerty_parse_ev(layout_t *state, kbd_event_t *ev)
    218 {
    219         wchar_t c;
     217static char32_t us_qwerty_parse_ev(layout_t *state, kbd_event_t *ev)
     218{
     219        char32_t c;
    220220
    221221        /* Produce no characters when Ctrl or Alt is pressed. */
     
    223223                return 0;
    224224
    225         c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t));
     225        c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char32_t));
    226226        if (c != 0)
    227227                return c;
    228228
    229229        if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0))
    230                 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t));
     230                c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(char32_t));
    231231        else
    232                 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t));
     232                c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(char32_t));
    233233
    234234        if (c != 0)
     
    236236
    237237        if ((ev->mods & KM_SHIFT) != 0)
    238                 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t));
     238                c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char32_t));
    239239        else
    240                 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t));
     240                c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char32_t));
    241241
    242242        if (c != 0)
     
    244244
    245245        if ((ev->mods & KM_NUM_LOCK) != 0)
    246                 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t));
     246                c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char32_t));
    247247        else
    248248                c = 0;
Note: See TracChangeset for help on using the changeset viewer.