Add wrappers/tests for keyboard, mouse and cursors
This commit is contained in:
parent
d479f8a121
commit
a0d3499d57
@ -18,11 +18,12 @@ v5: xfs_v5_ftype1_s05k_b2k_n8k.img xfs_v5_files_s05k_b4k_n8k.img
|
||||
|
||||
coverage: jfs.img xfs_borg_bit.img xfs_short_dir_i8.img
|
||||
|
||||
kolibri.img: ../default.skn
|
||||
kolibri.img: ../default.skn ../fill.cur
|
||||
touch $@
|
||||
fallocate -z -o 0 -l 1440KiB $@
|
||||
mkfs.vfat -n KOLIBRIOS -F 12 $@
|
||||
mcopy -vmoi $@ $< ::DEFAULT.SKN
|
||||
mcopy -vmoi $@ ../default.skn ::DEFAULT.SKN
|
||||
mcopy -vmoi $@ ../fill.cur ::FILL.CUR
|
||||
|
||||
jfs.img:
|
||||
fallocate -l 16MiB $@
|
||||
|
BIN
test/00ff.layout
Normal file
BIN
test/00ff.layout
Normal file
Binary file not shown.
@ -1,4 +1,5 @@
|
||||
/> umka_init
|
||||
/> set_mouse_pos_screen 40 30
|
||||
#disk_add ../img/kolibri.img rd -c 0
|
||||
/> ramdisk_init ../img/kolibri.img
|
||||
/rd/1: fat
|
||||
|
@ -1,4 +1,5 @@
|
||||
umka_init
|
||||
set_mouse_pos_screen 40 30
|
||||
#disk_add ../img/kolibri.img rd -c 0
|
||||
ramdisk_init ../img/kolibri.img
|
||||
set_skin /sys/DEFAULT.SKN
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 186 B |
343
test/049_#keyboard_#input_all.ref.log
Normal file
343
test/049_#keyboard_#input_all.ref.log
Normal file
@ -0,0 +1,343 @@
|
||||
/> umka_init
|
||||
|
||||
/> get_keyboard_mode
|
||||
keyboard_mode: 0 - ASCII
|
||||
/> get_keyboard_lang
|
||||
1 - en
|
||||
/> get_system_lang
|
||||
1 - en
|
||||
/> dump_key_buff
|
||||
|
||||
/> get_keyboard_lang
|
||||
1 - en
|
||||
/> set_keyboard_lang 0
|
||||
/> get_keyboard_lang
|
||||
invalid lang: 0
|
||||
/> set_keyboard_lang 1
|
||||
/> get_keyboard_lang
|
||||
1 - en
|
||||
/> set_keyboard_lang 2
|
||||
/> get_keyboard_lang
|
||||
2 - fi
|
||||
/> set_keyboard_lang 3
|
||||
/> get_keyboard_lang
|
||||
3 - ge
|
||||
/> set_keyboard_lang 4
|
||||
/> get_keyboard_lang
|
||||
4 - ru
|
||||
/> set_keyboard_lang 5
|
||||
/> get_keyboard_lang
|
||||
5 - fr
|
||||
/> set_keyboard_lang 6
|
||||
/> get_keyboard_lang
|
||||
6 - et
|
||||
/> set_keyboard_lang 7
|
||||
/> get_keyboard_lang
|
||||
7 - ua
|
||||
/> set_keyboard_lang 8
|
||||
/> get_keyboard_lang
|
||||
8 - it
|
||||
/> set_keyboard_lang 9
|
||||
/> get_keyboard_lang
|
||||
9 - be
|
||||
/> set_keyboard_lang 10
|
||||
/> get_keyboard_lang
|
||||
10 - sp
|
||||
/> set_keyboard_lang 11
|
||||
/> get_keyboard_lang
|
||||
11 - ca
|
||||
/> set_keyboard_lang 12
|
||||
/> get_keyboard_lang
|
||||
invalid lang: 12
|
||||
|
||||
/> get_system_lang
|
||||
1 - en
|
||||
/> set_system_lang 0
|
||||
/> get_system_lang
|
||||
invalid lang: 0
|
||||
/> set_system_lang 1
|
||||
/> get_system_lang
|
||||
1 - en
|
||||
/> set_system_lang 2
|
||||
/> get_system_lang
|
||||
2 - fi
|
||||
/> set_system_lang 3
|
||||
/> get_system_lang
|
||||
3 - ge
|
||||
/> set_system_lang 4
|
||||
/> get_system_lang
|
||||
4 - ru
|
||||
/> set_system_lang 5
|
||||
/> get_system_lang
|
||||
5 - fr
|
||||
/> set_system_lang 6
|
||||
/> get_system_lang
|
||||
6 - et
|
||||
/> set_system_lang 7
|
||||
/> get_system_lang
|
||||
7 - ua
|
||||
/> set_system_lang 8
|
||||
/> get_system_lang
|
||||
8 - it
|
||||
/> set_system_lang 9
|
||||
/> get_system_lang
|
||||
9 - be
|
||||
/> set_system_lang 10
|
||||
/> get_system_lang
|
||||
10 - sp
|
||||
/> set_system_lang 11
|
||||
/> get_system_lang
|
||||
11 - ca
|
||||
/> set_system_lang 12
|
||||
/> get_system_lang
|
||||
invalid lang: 12
|
||||
|
||||
/> set_keyboard_mode 0
|
||||
/> get_keyboard_mode
|
||||
keyboard_mode: 0 - ASCII
|
||||
/> send_scancode 3 5
|
||||
/> dump_key_buff
|
||||
0 0x32 0x03
|
||||
1 0x34 0x05
|
||||
/> get_key
|
||||
0x00033200
|
||||
/> dump_key_buff
|
||||
0 0x34 0x05
|
||||
|
||||
/> set_keyboard_mode 1
|
||||
/> get_keyboard_mode
|
||||
keyboard_mode: 1 - scancodes
|
||||
/> send_scancode 7 9
|
||||
/> dump_key_buff
|
||||
0 0x34 0x05
|
||||
1 0x07 0x00
|
||||
2 0x09 0x00
|
||||
/> get_key
|
||||
0x00053400
|
||||
/> dump_key_buff
|
||||
0 0x07 0x00
|
||||
1 0x09 0x00
|
||||
|
||||
/> get_key
|
||||
0x00000700
|
||||
/> get key_count
|
||||
1
|
||||
/> get_key
|
||||
0x00000900
|
||||
/> get key_count
|
||||
0
|
||||
/> get_key
|
||||
0x00000001
|
||||
/> get key_count
|
||||
0
|
||||
/> dump_key_buff
|
||||
|
||||
/> get_keyboard_layout -t 1
|
||||
0x36 0x1b 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2d 0x3d 0x08 0x09
|
||||
0x71 0x77 0x65 0x72 0x74 0x79 0x75 0x69 0x6f 0x70 0x5b 0x5d 0x0d 0x7e 0x61 0x73
|
||||
0x64 0x66 0x67 0x68 0x6a 0x6b 0x6c 0x3b 0x27 0x60 0x00 0x5c 0x7a 0x78 0x63 0x76
|
||||
0x62 0x6e 0x6d 0x2c 0x2e 0x2f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3c 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t 2
|
||||
0x36 0x1b 0x21 0x40 0x23 0x24 0x25 0x5e 0x26 0x2a 0x28 0x29 0x5f 0x2b 0x08 0x09
|
||||
0x51 0x57 0x45 0x52 0x54 0x59 0x55 0x49 0x4f 0x50 0x7b 0x7d 0x0d 0x7e 0x41 0x53
|
||||
0x44 0x46 0x47 0x48 0x4a 0x4b 0x4c 0x3a 0x22 0x7e 0x00 0x7c 0x5a 0x58 0x43 0x56
|
||||
0x42 0x4e 0x4d 0x3c 0x3e 0x3f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3e 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t 3
|
||||
0x20 0x1b 0x20 0x40 0x20 0x24 0x20 0x20 0x7b 0x5b 0x5d 0x7d 0x5c 0x20 0x08 0x09
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x0d 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x34 0x00 0x20 0x20 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x43 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t normal
|
||||
0x36 0x1b 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2d 0x3d 0x08 0x09
|
||||
0x71 0x77 0x65 0x72 0x74 0x79 0x75 0x69 0x6f 0x70 0x5b 0x5d 0x0d 0x7e 0x61 0x73
|
||||
0x64 0x66 0x67 0x68 0x6a 0x6b 0x6c 0x3b 0x27 0x60 0x00 0x5c 0x7a 0x78 0x63 0x76
|
||||
0x62 0x6e 0x6d 0x2c 0x2e 0x2f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3c 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t shift
|
||||
0x36 0x1b 0x21 0x40 0x23 0x24 0x25 0x5e 0x26 0x2a 0x28 0x29 0x5f 0x2b 0x08 0x09
|
||||
0x51 0x57 0x45 0x52 0x54 0x59 0x55 0x49 0x4f 0x50 0x7b 0x7d 0x0d 0x7e 0x41 0x53
|
||||
0x44 0x46 0x47 0x48 0x4a 0x4b 0x4c 0x3a 0x22 0x7e 0x00 0x7c 0x5a 0x58 0x43 0x56
|
||||
0x42 0x4e 0x4d 0x3c 0x3e 0x3f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3e 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t alt
|
||||
0x20 0x1b 0x20 0x40 0x20 0x24 0x20 0x20 0x7b 0x5b 0x5d 0x7d 0x5c 0x20 0x08 0x09
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x0d 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x34 0x00 0x20 0x20 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x43 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
|
||||
/> set_keyboard_layout -t 0 -f 00ff.layout
|
||||
status: -1
|
||||
/> get_keyboard_layout -t normal
|
||||
0x36 0x1b 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2d 0x3d 0x08 0x09
|
||||
0x71 0x77 0x65 0x72 0x74 0x79 0x75 0x69 0x6f 0x70 0x5b 0x5d 0x0d 0x7e 0x61 0x73
|
||||
0x64 0x66 0x67 0x68 0x6a 0x6b 0x6c 0x3b 0x27 0x60 0x00 0x5c 0x7a 0x78 0x63 0x76
|
||||
0x62 0x6e 0x6d 0x2c 0x2e 0x2f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3c 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t shift
|
||||
0x36 0x1b 0x21 0x40 0x23 0x24 0x25 0x5e 0x26 0x2a 0x28 0x29 0x5f 0x2b 0x08 0x09
|
||||
0x51 0x57 0x45 0x52 0x54 0x59 0x55 0x49 0x4f 0x50 0x7b 0x7d 0x0d 0x7e 0x41 0x53
|
||||
0x44 0x46 0x47 0x48 0x4a 0x4b 0x4c 0x3a 0x22 0x7e 0x00 0x7c 0x5a 0x58 0x43 0x56
|
||||
0x42 0x4e 0x4d 0x3c 0x3e 0x3f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3e 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t alt
|
||||
0x20 0x1b 0x20 0x40 0x20 0x24 0x20 0x20 0x7b 0x5b 0x5d 0x7d 0x5c 0x20 0x08 0x09
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x0d 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x34 0x00 0x20 0x20 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x43 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
|
||||
/> set_keyboard_layout -t 1 -f 00ff.layout
|
||||
status: 0
|
||||
/> get_keyboard_layout -t normal
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t shift
|
||||
0x36 0x1b 0x21 0x40 0x23 0x24 0x25 0x5e 0x26 0x2a 0x28 0x29 0x5f 0x2b 0x08 0x09
|
||||
0x51 0x57 0x45 0x52 0x54 0x59 0x55 0x49 0x4f 0x50 0x7b 0x7d 0x0d 0x7e 0x41 0x53
|
||||
0x44 0x46 0x47 0x48 0x4a 0x4b 0x4c 0x3a 0x22 0x7e 0x00 0x7c 0x5a 0x58 0x43 0x56
|
||||
0x42 0x4e 0x4d 0x3c 0x3e 0x3f 0x00 0x34 0x35 0x20 0x40 0x32 0x33 0x34 0x35 0x36
|
||||
0x37 0x38 0x39 0x30 0x31 0x32 0x33 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x3e 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
/> get_keyboard_layout -t alt
|
||||
0x20 0x1b 0x20 0x40 0x20 0x24 0x20 0x20 0x7b 0x5b 0x5d 0x7d 0x5c 0x20 0x08 0x09
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x0d 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x34 0x00 0x20 0x20 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x43 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
|
||||
/> set_keyboard_layout -t 2 -f 00ff.layout
|
||||
status: 0
|
||||
/> get_keyboard_layout -t normal
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t shift
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t alt
|
||||
0x20 0x1b 0x20 0x40 0x20 0x24 0x20 0x20 0x7b 0x5b 0x5d 0x7d 0x5c 0x20 0x08 0x09
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x0d 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x34 0x00 0x20 0x20 0x20 0x20 0x20 0x20 0x20
|
||||
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xb4 0xb2 0xb8 0x36 0xb0 0x37 0xb3 0x38 0xb5
|
||||
0xb1 0xb7 0xb9 0xb6 0x41 0x42 0x43 0x44 0xff 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c
|
||||
0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x41 0x42
|
||||
0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52
|
||||
|
||||
/> set_keyboard_layout -t 3 -f 00ff.layout
|
||||
status: 0
|
||||
/> get_keyboard_layout -t normal
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t shift
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t alt
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
|
||||
/> set_keyboard_layout -t 4 -f 00ff.layout
|
||||
status: -1
|
||||
/> get_keyboard_layout -t normal
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t shift
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
/> get_keyboard_layout -t alt
|
||||
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
|
||||
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
|
||||
0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f
|
||||
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f
|
||||
0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f
|
||||
0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f
|
||||
0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f
|
||||
0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f
|
||||
|
||||
/> set_keyboard_mode ascii
|
||||
/> send_scancode 0x11
|
||||
/> get_key
|
||||
0x00111100
|
120
test/049_#keyboard_#input_all.t
Normal file
120
test/049_#keyboard_#input_all.t
Normal file
@ -0,0 +1,120 @@
|
||||
umka_init
|
||||
|
||||
get_keyboard_mode
|
||||
get_keyboard_lang
|
||||
get_system_lang
|
||||
dump_key_buff
|
||||
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 0
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 1
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 2
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 3
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 4
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 5
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 6
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 7
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 8
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 9
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 10
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 11
|
||||
get_keyboard_lang
|
||||
set_keyboard_lang 12
|
||||
get_keyboard_lang
|
||||
|
||||
get_system_lang
|
||||
set_system_lang 0
|
||||
get_system_lang
|
||||
set_system_lang 1
|
||||
get_system_lang
|
||||
set_system_lang 2
|
||||
get_system_lang
|
||||
set_system_lang 3
|
||||
get_system_lang
|
||||
set_system_lang 4
|
||||
get_system_lang
|
||||
set_system_lang 5
|
||||
get_system_lang
|
||||
set_system_lang 6
|
||||
get_system_lang
|
||||
set_system_lang 7
|
||||
get_system_lang
|
||||
set_system_lang 8
|
||||
get_system_lang
|
||||
set_system_lang 9
|
||||
get_system_lang
|
||||
set_system_lang 10
|
||||
get_system_lang
|
||||
set_system_lang 11
|
||||
get_system_lang
|
||||
set_system_lang 12
|
||||
get_system_lang
|
||||
|
||||
set_keyboard_mode 0
|
||||
get_keyboard_mode
|
||||
send_scancode 3 5
|
||||
dump_key_buff
|
||||
get_key
|
||||
dump_key_buff
|
||||
|
||||
set_keyboard_mode 1
|
||||
get_keyboard_mode
|
||||
send_scancode 7 9
|
||||
dump_key_buff
|
||||
get_key
|
||||
dump_key_buff
|
||||
|
||||
get_key
|
||||
get key_count
|
||||
get_key
|
||||
get key_count
|
||||
get_key
|
||||
get key_count
|
||||
dump_key_buff
|
||||
|
||||
get_keyboard_layout -t 1
|
||||
get_keyboard_layout -t 2
|
||||
get_keyboard_layout -t 3
|
||||
get_keyboard_layout -t normal
|
||||
get_keyboard_layout -t shift
|
||||
get_keyboard_layout -t alt
|
||||
|
||||
set_keyboard_layout -t 0 -f 00ff.layout
|
||||
get_keyboard_layout -t normal
|
||||
get_keyboard_layout -t shift
|
||||
get_keyboard_layout -t alt
|
||||
|
||||
set_keyboard_layout -t 1 -f 00ff.layout
|
||||
get_keyboard_layout -t normal
|
||||
get_keyboard_layout -t shift
|
||||
get_keyboard_layout -t alt
|
||||
|
||||
set_keyboard_layout -t 2 -f 00ff.layout
|
||||
get_keyboard_layout -t normal
|
||||
get_keyboard_layout -t shift
|
||||
get_keyboard_layout -t alt
|
||||
|
||||
set_keyboard_layout -t 3 -f 00ff.layout
|
||||
get_keyboard_layout -t normal
|
||||
get_keyboard_layout -t shift
|
||||
get_keyboard_layout -t alt
|
||||
|
||||
set_keyboard_layout -t 4 -f 00ff.layout
|
||||
get_keyboard_layout -t normal
|
||||
get_keyboard_layout -t shift
|
||||
get_keyboard_layout -t alt
|
||||
|
||||
set_keyboard_mode ascii
|
||||
send_scancode 0x11
|
||||
get_key
|
14
test/050_#mouse_#input_all.ref.log
Normal file
14
test/050_#mouse_#input_all.ref.log
Normal file
@ -0,0 +1,14 @@
|
||||
/> umka_init
|
||||
|
||||
/> get_mouse_pos_screen
|
||||
x y: 200 150
|
||||
/> get_mouse_pos_window
|
||||
x y: 200 150
|
||||
/> get_mouse_buttons_state
|
||||
buttons held (left right middle 4th 5th): 0 0 0 0 0
|
||||
/> get_mouse_buttons_state_events
|
||||
buttons held (left right middle 4th 5th): 0 0 0 0 0
|
||||
buttons pressed (left right middle): 0 0 0
|
||||
buttons released (left right middle): 0 0 0
|
||||
left button double click: 0
|
||||
scrolls used (vertical horizontal): 0 0
|
6
test/050_#mouse_#input_all.t
Normal file
6
test/050_#mouse_#input_all.t
Normal file
@ -0,0 +1,6 @@
|
||||
umka_init
|
||||
|
||||
get_mouse_pos_screen
|
||||
get_mouse_pos_window
|
||||
get_mouse_buttons_state
|
||||
get_mouse_buttons_state_events
|
22
test/051_#draw_#cursor_all.ref.log
Normal file
22
test/051_#draw_#cursor_all.ref.log
Normal file
@ -0,0 +1,22 @@
|
||||
/> umka_init
|
||||
#set_mouse_pos_screen 40 30
|
||||
/> ramdisk_init ../img/kolibri.img
|
||||
/rd/1: fat
|
||||
/> set_skin /sys/DEFAULT.SKN
|
||||
status: 0
|
||||
|
||||
/> load_cursor_from_file /sys/fill.cur
|
||||
handle = non-zero
|
||||
/> load_cursor_from_mem ../spray.cur
|
||||
handle = non-zero
|
||||
|
||||
/> window_redraw 1
|
||||
/> draw_window 10 300 5 200 0x000088 1 1 1 0 1 4 hello
|
||||
/> window_redraw 2
|
||||
|
||||
|
||||
|
||||
/> scrot 051_#draw_#cursor_all.out.png
|
||||
|
||||
|
||||
/> disk_del rd
|
18
test/051_#draw_#cursor_all.t
Normal file
18
test/051_#draw_#cursor_all.t
Normal file
@ -0,0 +1,18 @@
|
||||
umka_init
|
||||
#set_mouse_pos_screen 40 30
|
||||
ramdisk_init ../img/kolibri.img
|
||||
set_skin /sys/DEFAULT.SKN
|
||||
|
||||
load_cursor_from_file /sys/fill.cur
|
||||
load_cursor_from_mem ../spray.cur
|
||||
|
||||
window_redraw 1
|
||||
draw_window 10 300 5 200 0x000088 1 1 1 0 1 4 hello
|
||||
window_redraw 2
|
||||
|
||||
|
||||
|
||||
scrot 051_#draw_#cursor_all.out.png
|
||||
|
||||
|
||||
disk_del rd
|
@ -28,8 +28,10 @@ i40_tests := $(addsuffix .out.log, $(basename $(wildcard *\#i40_*.t)))
|
||||
net_tests := $(addsuffix .out.log, $(basename $(wildcard *\#net_*.t)))
|
||||
arp_tests := $(addsuffix .out.log, $(basename $(wildcard *\#arp_*.t)))
|
||||
acpi_tests := $(addsuffix .out.log, $(basename $(wildcard *\#acpi_*.t)))
|
||||
input_tests := $(addsuffix .out.log, $(basename $(wildcard *\#input_*.t)))
|
||||
|
||||
all: xfs exfat s05k s4k f30 f70 f70s0 f70s1 f70s5 lookup bug xattr unicode v5 draw coverage i40 net arp acpi
|
||||
all: xfs exfat s05k s4k f30 f70 f70s0 f70s1 f70s5 lookup bug xattr unicode v5 \
|
||||
draw coverage i40 net arp acpi input
|
||||
@echo all tests passed
|
||||
|
||||
xfs: $(xfs_tests)
|
||||
@ -52,6 +54,7 @@ i40: $(i40_tests)
|
||||
net: $(net_tests)
|
||||
arp: $(arp_tests)
|
||||
acpi: $(acpi_tests)
|
||||
input: $(input_tests)
|
||||
|
||||
%.out.log: %.t
|
||||
$(UMKA_SHELL) -i $*.t
|
||||
|
20
umka.asm
20
umka.asm
@ -79,6 +79,14 @@ UMKA_OS = 3
|
||||
|
||||
UMKA_MEMORY_BYTES = 256 SHL 20
|
||||
|
||||
pubsym set_keyboard_data, 'kos_set_keyboard_data'
|
||||
pubsym KEY_COUNT as 'kos_key_count'
|
||||
pubsym KEY_BUFF as 'kos_key_buff'
|
||||
pubsym keyboard_mode as 'kos_keyboard_mode'
|
||||
pubsym sys_getkey as 'kos_get_key'
|
||||
pubsym syslang as 'kos_syslang'
|
||||
pubsym keyboard as 'kos_keyboard'
|
||||
|
||||
pubsym disk_add, 16
|
||||
pubsym disk_del, 4
|
||||
pubsym disk_list
|
||||
@ -566,8 +574,6 @@ proc umka_init c uses ebx esi edi ebp
|
||||
|
||||
mov [X_UNDER], 500
|
||||
mov [Y_UNDER], 500
|
||||
mov word[MOUSE_X], 40
|
||||
mov word[MOUSE_Y], 30
|
||||
|
||||
mov eax, -1
|
||||
mov edi, thr_slot_map+4
|
||||
@ -625,6 +631,14 @@ proc umka_init c uses ebx esi edi ebp
|
||||
mov [SLOT_BASE+APPDATA.cursor+sizeof.APPDATA*2], eax
|
||||
|
||||
; from set_variables
|
||||
mov ax, [BOOT.y_res]
|
||||
shr ax, 1
|
||||
shl eax, 16
|
||||
mov ax, [BOOT.x_res]
|
||||
shr ax, 1
|
||||
mov [MOUSE_X], eax
|
||||
call wakeup_osloop
|
||||
|
||||
xor eax, eax
|
||||
mov [BTN_ADDR], dword BUTTON_INFO ; address of button list
|
||||
mov byte [KEY_COUNT], al ; keyboard buffer
|
||||
@ -894,7 +908,7 @@ WIN_POS rw 0x200
|
||||
FDD_BUFF: rb 0x400
|
||||
WIN_TEMP_XY rb 0x100
|
||||
KEY_COUNT db ?
|
||||
KEY_BUFF rb 255 ; 120*2 + 2*2 = 244 bytes, actually 255 bytes
|
||||
KEY_BUFF rb 244 ; 120*2 + 2*2 = 244 bytes, actually 255 bytes
|
||||
BTN_COUNT db ?
|
||||
BTN_BUFF rd 0x261
|
||||
BTN_ADDR dd ?
|
||||
|
281
umka.h
281
umka.h
@ -17,9 +17,62 @@ typedef void siginfo_t;
|
||||
|
||||
#define STDCALL __attribute__((__stdcall__))
|
||||
|
||||
#define KEYBOARD_MODE_ASCII 0
|
||||
#define KEYBOARD_MODE_SCANCODES 1
|
||||
|
||||
enum kos_lang {
|
||||
KOS_LANG_EN = 1,
|
||||
KOS_LANG_FIRST = KOS_LANG_EN,
|
||||
KOS_LANG_FI,
|
||||
KOS_LANG_GE,
|
||||
KOS_LANG_RU,
|
||||
KOS_LANG_FR,
|
||||
KOS_LANG_ET,
|
||||
KOS_LANG_UA,
|
||||
KOS_LANG_IT,
|
||||
KOS_LANG_BE,
|
||||
KOS_LANG_SP,
|
||||
KOS_LANG_CA,
|
||||
KOS_LANG_LAST = KOS_LANG_CA
|
||||
};
|
||||
|
||||
#define KOS_LAYOUT_SIZE 128
|
||||
|
||||
#define BDFE_LEN_CP866 304
|
||||
#define BDFE_LEN_UNICODE 560
|
||||
|
||||
struct point16s {
|
||||
int16_t y, x;
|
||||
};
|
||||
|
||||
struct mouse_state {
|
||||
uint8_t bl_held:1;
|
||||
uint8_t br_held:1;
|
||||
uint8_t bm_held:1;
|
||||
uint8_t b4_held:1;
|
||||
uint8_t b5_held:1;
|
||||
};
|
||||
|
||||
struct mouse_events {
|
||||
uint8_t bl_pressed:1;
|
||||
uint8_t br_pressed:1;
|
||||
uint8_t bm_pressed:1;
|
||||
uint8_t :5;
|
||||
uint8_t vscroll_used:1;
|
||||
uint8_t bl_released:1;
|
||||
uint8_t br_released:1;
|
||||
uint8_t bm_released:1;
|
||||
uint8_t :4;
|
||||
uint8_t hscroll_used:1;
|
||||
uint8_t bl_dbclick:1;
|
||||
uint8_t :6;
|
||||
};
|
||||
|
||||
struct mouse_state_events {
|
||||
struct mouse_state st;
|
||||
struct mouse_events ev;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint32_t left, top, right, bottom;
|
||||
} rect_t;
|
||||
@ -852,6 +905,11 @@ extern uint32_t kos_acpi_node_alloc_cnt;
|
||||
extern uint32_t kos_acpi_node_free_cnt;
|
||||
extern uint32_t kos_acpi_count_nodes(void *ctx) STDCALL;
|
||||
extern disk_t disk_list;
|
||||
extern uint8_t kos_key_count;
|
||||
extern uint8_t kos_key_buff[120*2 + 2*2];
|
||||
extern uint8_t kos_keyboard_mode;
|
||||
extern uint32_t kos_syslang;
|
||||
extern uint32_t kos_keyboard;
|
||||
|
||||
static inline void
|
||||
umka_scheduler_add_thread(appdata_t *thread, int32_t priority) {
|
||||
@ -947,6 +1005,17 @@ umka_sys_set_pixel(size_t x, size_t y, uint32_t color, int invert) {
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
umka_get_key() {
|
||||
uint32_t key;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(key)
|
||||
: "a"(2)
|
||||
: "memory");
|
||||
return key;
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_write_text(size_t x, size_t y, uint32_t color, int asciiz,
|
||||
int fill_background, int font_and_encoding,
|
||||
@ -1123,6 +1192,97 @@ umka_sys_bg_unmap(void *addr) {
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_set_mouse_pos_screen(struct point16s new_pos) {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
:
|
||||
: "a"(18),
|
||||
"b"(19),
|
||||
"c"(4),
|
||||
"d"(new_pos)
|
||||
:);
|
||||
}
|
||||
|
||||
static inline int
|
||||
umka_sys_set_keyboard_layout(int type, void *layout) {
|
||||
int status;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(status)
|
||||
: "a"(21),
|
||||
"b"(2),
|
||||
"c"(type),
|
||||
"d"(layout)
|
||||
: "memory");
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int
|
||||
umka_sys_set_keyboard_lang(enum kos_lang lang_id) {
|
||||
int status;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(status)
|
||||
: "a"(21),
|
||||
"b"(2),
|
||||
"c"(9),
|
||||
"d"(lang_id)
|
||||
: "memory");
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int
|
||||
umka_sys_set_system_lang(enum kos_lang lang_id) {
|
||||
int status;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(status)
|
||||
: "a"(21),
|
||||
"b"(5),
|
||||
"c"(lang_id)
|
||||
: "memory");
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_get_keyboard_layout(int type, void *layout) {
|
||||
int status;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(status)
|
||||
: "a"(26),
|
||||
"b"(2),
|
||||
"c"(type),
|
||||
"d"(layout)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline int
|
||||
umka_sys_get_keyboard_lang() {
|
||||
int status;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(status)
|
||||
: "a"(26),
|
||||
"b"(2),
|
||||
"c"(9)
|
||||
:);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int
|
||||
umka_sys_get_system_lang() {
|
||||
int status;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(status)
|
||||
: "a"(26),
|
||||
"b"(5)
|
||||
:);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_set_cwd(const char *dir) {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
@ -1146,6 +1306,95 @@ umka_sys_get_cwd(const char *buf, size_t len) {
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline struct point16s
|
||||
umka_sys_get_mouse_pos_screen() {
|
||||
struct point16s pos;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(pos)
|
||||
: "a"(37),
|
||||
"b"(0)
|
||||
:);
|
||||
return pos;
|
||||
}
|
||||
|
||||
static inline struct point16s
|
||||
umka_sys_get_mouse_pos_window() {
|
||||
struct point16s pos;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(pos)
|
||||
: "a"(37),
|
||||
"b"(1)
|
||||
:);
|
||||
return pos;
|
||||
}
|
||||
|
||||
static inline struct mouse_state
|
||||
umka_sys_get_mouse_buttons_state() {
|
||||
struct mouse_state mouse;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(mouse)
|
||||
: "a"(37),
|
||||
"b"(2)
|
||||
:);
|
||||
return mouse;
|
||||
}
|
||||
|
||||
static inline struct mouse_state_events
|
||||
umka_sys_get_mouse_buttons_state_events() {
|
||||
union {uint32_t x; struct mouse_state_events m;} u;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(u.x)
|
||||
: "a"(37),
|
||||
"b"(3)
|
||||
:);
|
||||
return u.m;
|
||||
}
|
||||
|
||||
static inline void*
|
||||
umka_sys_load_cursor_from_file(const char *fname) {
|
||||
void *handle;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(handle)
|
||||
: "a"(37),
|
||||
"b"(4),
|
||||
"c"(fname),
|
||||
"d"(0)
|
||||
:);
|
||||
return handle;
|
||||
}
|
||||
|
||||
static inline void*
|
||||
umka_sys_load_cursor_from_mem(void *data) {
|
||||
void *handle;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(handle)
|
||||
: "a"(37),
|
||||
"b"(4),
|
||||
"c"(data),
|
||||
"d"(1)
|
||||
:);
|
||||
return handle;
|
||||
}
|
||||
|
||||
static inline void*
|
||||
umka_sys_set_cursor(void *handle) {
|
||||
void *prev;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(prev)
|
||||
: "a"(37),
|
||||
"b"(5),
|
||||
"c"(handle)
|
||||
: "memory");
|
||||
return prev;
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_draw_line(size_t x, size_t xend, size_t y, size_t yend, uint32_t color,
|
||||
int invert) {
|
||||
@ -1348,6 +1597,29 @@ umka_sys_put_image_palette(void *image, size_t xsize, size_t ysize,
|
||||
umka_i40(®s);
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_set_keyboard_mode(int mode) {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
:
|
||||
: "a"(66),
|
||||
"b"(1),
|
||||
"c"(mode)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline int
|
||||
umka_sys_get_keyboard_mode() {
|
||||
int mode;
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call i40"
|
||||
: "=a"(mode)
|
||||
: "a"(66),
|
||||
"b"(2)
|
||||
: "memory");
|
||||
return mode;
|
||||
}
|
||||
|
||||
static inline void
|
||||
umka_sys_move_window(size_t x, size_t y, ssize_t xsize, ssize_t ysize) {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
@ -1848,4 +2120,13 @@ umka_sys_net_arp_del_entry(uint32_t dev_num, int32_t arp_num) {
|
||||
// Function 76, Protocol 5 - ARP, Subfunction 6, Send ARP announce ==
|
||||
// Function 76, Protocol 5 - ARP, Subfunction 7, Read # conflicts ===
|
||||
|
||||
static inline void
|
||||
umka_set_keyboard_data(uint32_t scancode) {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"call kos_set_keyboard_data"
|
||||
:
|
||||
: "c"(scancode)
|
||||
: "eax", "edx", "memory", "cc");
|
||||
}
|
||||
|
||||
#endif // UMKA_H_INCLUDED
|
||||
|
Loading…
Reference in New Issue
Block a user