Changeset fa09449 in mainline for uspace/srv/kbd/genarch/src/nofb.c


Ignore:
Timestamp:
2009-02-15T22:31:07Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6cd9aa6
Parents:
76dd25b
Message:

Keycodes, keyboard events, kbd_event_get(). Keyboard driver now (formally) produces kbd events (press/release, keycode, mods, char) instead of just characters. In reality, the driver and client are only hacked to work with the new interface atm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/kbd/genarch/src/nofb.c

    r76dd25b rfa09449  
    6767                switch (buf) {
    6868                case KEY_F5:
    69                         keybuffer_push(keybuffer,FUNCTION_KEYS | 5);
     69                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 5);
    7070                        buf = count = 0;
    7171                        return 1;
    7272                case KEY_F6:
    73                         keybuffer_push(keybuffer,FUNCTION_KEYS | 6);
     73                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 6);
    7474                        buf = count = 0;
    7575                        return 1;
    7676                case KEY_F7:
    77                         keybuffer_push(keybuffer,FUNCTION_KEYS | 7);
     77                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 7);
    7878                        buf = count = 0;
    7979                        return 1;
    8080                case KEY_F8:
    81                         keybuffer_push(keybuffer,FUNCTION_KEYS | 8);
     81                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 8);
    8282                        buf = count = 0;
    8383                        return 1;
    8484                case KEY_F9:
    85                         keybuffer_push(keybuffer,FUNCTION_KEYS | 9);
     85                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 9);
    8686                        buf = count = 0;
    8787                        return 1;
    8888                case KEY_F10:
    89                         keybuffer_push(keybuffer,FUNCTION_KEYS | 10);
     89                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 10);
    9090                        buf = count = 0;
    9191                        return 1;
    9292                case KEY_F11:
    93                         keybuffer_push(keybuffer,FUNCTION_KEYS | 11);
     93                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 11);
    9494                        buf = count = 0;
    9595                        return 1;
    9696                case KEY_F12:
    97                         keybuffer_push(keybuffer,FUNCTION_KEYS | 12);
     97                        keybuffer_push0(keybuffer,FUNCTION_KEYS | 12);
    9898                        buf = count = 0;
    9999                        return 1;
    100100                default:
    101                         keybuffer_push(keybuffer, buf & 0xff);
    102                         keybuffer_push(keybuffer, (buf >> 8) &0xff);
    103                         keybuffer_push(keybuffer, (buf >> 16) &0xff);
    104                         keybuffer_push(keybuffer, (buf >> 24) &0xff);
    105                         keybuffer_push(keybuffer, scan_code);
     101                        keybuffer_push0(keybuffer, buf & 0xff);
     102                        keybuffer_push0(keybuffer, (buf >> 8) &0xff);
     103                        keybuffer_push0(keybuffer, (buf >> 16) &0xff);
     104                        keybuffer_push0(keybuffer, (buf >> 24) &0xff);
     105                        keybuffer_push0(keybuffer, scan_code);
    106106                        buf = count = 0;
    107107                        return 1;
     
    112112       
    113113        if((buf & 0xff) != (KEY_F1 & 0xff)) {
    114                 keybuffer_push(keybuffer, buf);
     114                keybuffer_push0(keybuffer, buf);
    115115                buf = count = 0;
    116116                return 1;
     
    123123                && (buf & 0xffff) != (KEY_F5 & 0xffff) ) {
    124124
    125                 keybuffer_push(keybuffer, buf & 0xff);
    126                 keybuffer_push(keybuffer, (buf >> 8) &0xff);
     125                keybuffer_push0(keybuffer, buf & 0xff);
     126                keybuffer_push0(keybuffer, (buf >> 8) &0xff);
    127127                buf = count = 0;
    128128                return 1;
     
    134134        switch (buf) {
    135135        case KEY_F1:
    136                 keybuffer_push(keybuffer,FUNCTION_KEYS | 1);
     136                keybuffer_push0(keybuffer,FUNCTION_KEYS | 1);
    137137                buf = count = 0;
    138138                return 1;
    139139        case KEY_F2:
    140                 keybuffer_push(keybuffer,FUNCTION_KEYS | 2);
     140                keybuffer_push0(keybuffer,FUNCTION_KEYS | 2);
    141141                buf = count = 0;
    142142                return 1;
    143143        case KEY_F3:
    144                 keybuffer_push(keybuffer,FUNCTION_KEYS | 3);
     144                keybuffer_push0(keybuffer,FUNCTION_KEYS | 3);
    145145                buf = count = 0;
    146146                return 1;
    147147        case KEY_F4:
    148                 keybuffer_push(keybuffer,FUNCTION_KEYS | 4);
     148                keybuffer_push0(keybuffer,FUNCTION_KEYS | 4);
    149149                buf = count = 0;
    150150                return 1;
     
    155155                && (buf & 0xffffff) != (KEY_F9 & 0xffffff)) {
    156156
    157                 keybuffer_push(keybuffer, buf & 0xff);
    158                 keybuffer_push(keybuffer, (buf >> 8) & 0xff);
    159                 keybuffer_push(keybuffer, (buf >> 16) & 0xff);
     157                keybuffer_push0(keybuffer, buf & 0xff);
     158                keybuffer_push0(keybuffer, (buf >> 8) & 0xff);
     159                keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
    160160                buf=count=0;
    161161                return 1;
     
    176176                return 1;
    177177        default:
    178                 keybuffer_push(keybuffer, buf & 0xff);
    179                 keybuffer_push(keybuffer, (buf >> 8) &0xff);
    180                 keybuffer_push(keybuffer, (buf >> 16) &0xff);
    181                 keybuffer_push(keybuffer, (buf >> 24) &0xff);
     178                keybuffer_push0(keybuffer, buf & 0xff);
     179                keybuffer_push0(keybuffer, (buf >> 8) &0xff);
     180                keybuffer_push0(keybuffer, (buf >> 16) &0xff);
     181                keybuffer_push0(keybuffer, (buf >> 24) &0xff);
    182182                buf = count = 0;
    183183                return 1;
Note: See TracChangeset for help on using the changeset viewer.