Rev 1694 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1694 | Rev 1740 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | ski_cmds |
65 | ski_cmds |
66 | }; |
66 | }; |
67 | 67 | ||
68 | int kbd_arch_init(void) |
68 | int kbd_arch_init(void) |
69 | { |
69 | { |
70 | if(sysinfo_value("kbd")) { |
70 | if (sysinfo_value("kbd")) { |
71 | ipc_register_irq(sysinfo_value("kbd.irq"), &ski_kbd); |
71 | ipc_register_irq(sysinfo_value("kbd.irq"), &ski_kbd); |
72 | return 0; |
72 | return 0; |
73 | } |
73 | } |
74 | return 1; |
74 | return 1; |
75 | } |
75 | } |
Line 90... | Line 90... | ||
90 | static int esc_count=0; |
90 | static int esc_count=0; |
91 | int scan_code = IPC_GET_ARG2(*call); |
91 | int scan_code = IPC_GET_ARG2(*call); |
92 | 92 | ||
93 | 93 | ||
94 | /* |
94 | /* |
95 | * Please preserve this code (it can be used to determine scancodes) |
95 | * Please preserve this code (it can be used to determine scancodes) |
96 | */ |
96 | */ |
97 | //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf)); |
97 | //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf)); |
98 | //keybuffer_push(keybuffer, to_hex(scan_code&0xf)); |
98 | //keybuffer_push(keybuffer, to_hex(scan_code&0xf)); |
99 | //keybuffer_push(keybuffer, ' '); |
99 | //keybuffer_push(keybuffer, ' '); |
100 | //keybuffer_push(keybuffer, ' '); |
100 | //keybuffer_push(keybuffer, ' '); |
101 | //*/ |
101 | //*/ |
102 | 102 | ||
103 | - | ||
104 | if (scan_code){ |
103 | if (scan_code) { |
105 | buf|=(unsigned long long) scan_code<<(8*(count++)); |
104 | buf |= (unsigned long long) scan_code<<(8*(count++)); |
106 | } else { |
105 | } else { |
107 | 106 | ||
108 | 107 | ||
109 | if ( buf == 0x1b ) { |
108 | if (buf == 0x1b) { |
110 | esc_count++; |
109 | esc_count++; |
111 | if ( esc_count == 3 ) { |
110 | if (esc_count == 3) { |
112 | __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE); |
111 | __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE); |
113 | } |
112 | } |
114 | } else { |
113 | } else { |
115 | esc_count=0; |
114 | esc_count = 0; |
116 | } |
115 | } |
117 | 116 | ||
118 | if ( ! ( buf & 0xff00 )) |
117 | if (!(buf & 0xff00)) { |
119 | keybuffer_push(keybuffer, buf); |
118 | keybuffer_push(keybuffer, buf); |
120 | else { |
119 | } else { |
121 | switch (buf){ |
120 | switch (buf) { |
122 | case KEY_F1: |
121 | case KEY_F1: |
123 | keybuffer_push(keybuffer,FUNCTION_KEYS | 1 ); |
122 | keybuffer_push(keybuffer, FUNCTION_KEYS | 1); |
124 | break; |
123 | break; |
125 | case KEY_F2: |
124 | case KEY_F2: |
126 | keybuffer_push(keybuffer,FUNCTION_KEYS | 2 ); |
125 | keybuffer_push(keybuffer, FUNCTION_KEYS | 2); |
127 | break; |
126 | break; |
128 | case KEY_F3: |
127 | case KEY_F3: |
129 | keybuffer_push(keybuffer,FUNCTION_KEYS | 3 ); |
128 | keybuffer_push(keybuffer, FUNCTION_KEYS | 3); |
130 | break; |
129 | break; |
131 | case KEY_F4: |
130 | case KEY_F4: |
132 | keybuffer_push(keybuffer,FUNCTION_KEYS | 4 ); |
131 | keybuffer_push(keybuffer, FUNCTION_KEYS | 4); |
133 | break; |
132 | break; |
134 | case KEY_F5: |
133 | case KEY_F5: |
135 | keybuffer_push(keybuffer,FUNCTION_KEYS | 5 ); |
134 | keybuffer_push(keybuffer, FUNCTION_KEYS | 5); |
136 | break; |
135 | break; |
137 | case KEY_F6: |
136 | case KEY_F6: |
138 | keybuffer_push(keybuffer,FUNCTION_KEYS | 6 ); |
137 | keybuffer_push(keybuffer, FUNCTION_KEYS | 6); |
139 | break; |
138 | break; |
140 | case KEY_F7: |
139 | case KEY_F7: |
141 | keybuffer_push(keybuffer,FUNCTION_KEYS | 7 ); |
140 | keybuffer_push(keybuffer, FUNCTION_KEYS | 7); |
142 | break; |
141 | break; |
143 | case KEY_F8: |
142 | case KEY_F8: |
144 | keybuffer_push(keybuffer,FUNCTION_KEYS | 8 ); |
143 | keybuffer_push(keybuffer, FUNCTION_KEYS | 8); |
145 | break; |
144 | break; |
146 | - | ||
147 | case KEY_F9: |
145 | case KEY_F9: |
148 | keybuffer_push(keybuffer,FUNCTION_KEYS | 9 ); |
146 | keybuffer_push(keybuffer, FUNCTION_KEYS | 9); |
149 | break; |
147 | break; |
150 | case KEY_F10: |
148 | case KEY_F10: |
151 | keybuffer_push(keybuffer,FUNCTION_KEYS | 10 ); |
149 | keybuffer_push(keybuffer, FUNCTION_KEYS | 10); |
152 | break; |
150 | break; |
153 | - | ||
154 | case KEY_F11: |
151 | case KEY_F11: |
155 | keybuffer_push(keybuffer,FUNCTION_KEYS | 11 ); |
152 | keybuffer_push(keybuffer, FUNCTION_KEYS | 11); |
156 | break; |
153 | break; |
157 | case KEY_F12: |
154 | case KEY_F12: |
158 | keybuffer_push(keybuffer,FUNCTION_KEYS | 12 ); |
155 | keybuffer_push(keybuffer, FUNCTION_KEYS | 12); |
159 | break; |
156 | break; |
160 | - | ||
161 | - | ||
162 | } |
157 | } |
163 | } |
158 | } |
164 | buf=count=0; |
159 | buf = count = 0; |
165 | } |
160 | } |
166 | 161 | ||
167 | return 1; |
162 | return 1; |
168 | } |
163 | } |
169 | 164 |