Subversion Repositories HelenOS

Rev

Rev 4153 | Rev 4327 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4153 Rev 4263
Line 68... Line 68...
68
static unsigned lock_keys;
68
static unsigned lock_keys;
69
 
69
 
70
int cir_service = 0;
70
int cir_service = 0;
71
int cir_phone = -1;
71
int cir_phone = -1;
72
 
72
 
-
 
73
#define NUM_LAYOUTS 3
-
 
74
 
-
 
75
static layout_op_t *layout[NUM_LAYOUTS] = {
-
 
76
    &us_qwerty_op,
-
 
77
    &us_dvorak_op,
-
 
78
    &cz_op
-
 
79
};
-
 
80
 
-
 
81
static int active_layout = 0;
-
 
82
 
73
void kbd_push_scancode(int scancode)
83
void kbd_push_scancode(int scancode)
74
{
84
{
75
/*  printf("scancode: 0x%x\n", scancode);*/
85
/*  printf("scancode: 0x%x\n", scancode);*/
76
    kbd_ctl_parse_scancode(scancode);
86
    kbd_ctl_parse_scancode(scancode);
77
}
87
}
Line 121... Line 131...
121
/*
131
/*
122
    printf("type: %d\n", type);
132
    printf("type: %d\n", type);
123
    printf("mods: 0x%x\n", mods);
133
    printf("mods: 0x%x\n", mods);
124
    printf("keycode: %u\n", key);
134
    printf("keycode: %u\n", key);
125
*/
135
*/
-
 
136
    if (type == KE_PRESS && (mods & KM_LCTRL) &&
-
 
137
        key == KC_F1) {
-
 
138
        active_layout = 0;
-
 
139
        return;
-
 
140
    }
-
 
141
 
-
 
142
    if (type == KE_PRESS && (mods & KM_LCTRL) &&
-
 
143
        key == KC_F2) {
-
 
144
        active_layout = 1;
-
 
145
        return;
-
 
146
    }
-
 
147
 
-
 
148
    if (type == KE_PRESS && (mods & KM_LCTRL) &&
-
 
149
        key == KC_F3) {
-
 
150
        active_layout = 2;
-
 
151
        return;
-
 
152
    }
-
 
153
 
126
    ev.type = type;
154
    ev.type = type;
127
    ev.key = key;
155
    ev.key = key;
128
    ev.mods = mods;
156
    ev.mods = mods;
129
 
157
 
130
    ev.c = layout_parse_ev(&ev);
158
    ev.c = layout[active_layout]->parse_ev(&ev);
131
 
159
 
132
    async_msg_4(phone2cons, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
160
    async_msg_4(phone2cons, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
133
}
161
}
134
 
162
 
135
static void console_connection(ipc_callid_t iid, ipc_call_t *icall)
163
static void console_connection(ipc_callid_t iid, ipc_call_t *icall)