Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5677 | hidnplayr | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
3 | ;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; |
||
4 | ;; Distributed under terms of the GNU General Public License ;; |
||
5 | ;; ;; |
||
6 | ;; VNC client for KolibriOS ;; |
||
7 | ;; ;; |
||
8 | ;; Written by hidnplayr@kolibrios.org ;; |
||
9 | ;; ;; |
||
10 | ;; GNU GENERAL PUBLIC LICENSE ;; |
||
11 | ;; Version 2, June 1991 ;; |
||
12 | ;; ;; |
||
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
14 | |||
15 | generate_keymap: |
||
16 | |||
17 | ; Read keymaps from kernel |
||
18 | mcall 26, 2, 1, keymap+128 |
||
19 | mcall 26, 2, 2, keymap_shift+128 |
||
20 | mcall 26, 2, 3, keymap_alt+128 |
||
21 | |||
22 | mov esi, keymap+128 |
||
23 | mov edi, keymap |
||
24 | mov ecx, 128 |
||
25 | call convert_keymap |
||
26 | |||
27 | mov esi, keymap_shift+128 |
||
28 | mov edi, keymap_shift |
||
29 | mov ecx, 128 |
||
30 | call convert_keymap |
||
31 | |||
32 | mov esi, keymap_alt+128 |
||
33 | mov edi, keymap_alt |
||
34 | mov ecx, 128 |
||
35 | call convert_keymap |
||
36 | |||
37 | ret |
||
38 | |||
39 | |||
40 | |||
41 | convert_keymap: |
||
42 | .loop: |
||
43 | lodsb |
||
44 | |||
45 | cmp al, 0x08 ; Backspace |
||
46 | jne @f |
||
47 | mov ax, 0x08ff |
||
48 | jmp .next |
||
49 | @@: |
||
50 | cmp al, 0x09 ; Tab |
||
51 | jne @f |
||
52 | mov ax, 0x09ff |
||
53 | jmp .next |
||
54 | @@: |
||
55 | cmp al, 0x0d ; Enter |
||
56 | jne @f |
||
57 | mov ax, 0x0dff |
||
58 | jmp .next |
||
59 | @@: |
||
60 | cmp al, 0x1b ; Escape |
||
61 | jne @f |
||
62 | mov ax, 0x1bff |
||
63 | jmp .next |
||
64 | @@: |
||
65 | cmp al, 0x34 ; Insert |
||
66 | jne @f |
||
67 | mov ax, 0x63ff |
||
68 | jmp .next |
||
69 | @@: |
||
70 | cmp al, 0xb6 ; Delete |
||
71 | jne @f |
||
72 | mov ax, 0xffff |
||
73 | jmp .next |
||
74 | @@: |
||
75 | cmp al, 0xb4 ; Home |
||
76 | jne @f |
||
77 | mov ax, 0x50ff |
||
78 | jmp .next |
||
79 | @@: |
||
80 | cmp al, 0xb5 ; End |
||
81 | jne @f |
||
82 | mov ax, 0x57ff |
||
83 | jmp .next |
||
84 | @@: |
||
85 | cmp al, 0xb8 ; PgUp |
||
86 | jne @f |
||
87 | mov ax, 0x55ff |
||
88 | jmp .next |
||
89 | @@: |
||
90 | cmp al, 0xb7 ; PgDown |
||
91 | jne @f |
||
92 | mov ax, 0x56ff |
||
93 | jmp .next |
||
94 | @@: |
||
95 | cmp al, 0xb0 ; Left |
||
96 | jne @f |
||
97 | mov ax, 0x51ff |
||
98 | jmp .next |
||
99 | @@: |
||
100 | cmp al, 0xb2 ; Up |
||
101 | jne @f |
||
102 | mov ax, 0x52ff |
||
103 | jmp .next |
||
104 | @@: |
||
105 | cmp al, 0xb3 ; Right |
||
106 | jne @f |
||
107 | mov ax, 0x53ff |
||
108 | jmp .next |
||
109 | @@: |
||
110 | cmp al, 0xb1 ; Down |
||
111 | jne @f |
||
112 | mov ax, 0x54ff |
||
113 | jmp .next |
||
114 | @@: |
||
115 | |||
116 | shl ax, 8 |
||
117 | .next: |
||
118 | stosw |
||
119 | dec ecx |
||
120 | jnz .loop |
||
121 | ret |