forked from KolibriOS/kolibrios
KEYASCII - modified for kernel SVN r.4588
git-svn-id: svn://kolibrios.org@4589 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
ce96116465
commit
2a658d4655
@ -39,6 +39,8 @@ still:
|
|||||||
mov eax,2 ; just read it and ignore
|
mov eax,2 ; just read it and ignore
|
||||||
mcall
|
mcall
|
||||||
mov [keyid],ah
|
mov [keyid],ah
|
||||||
|
shr eax,16
|
||||||
|
mov [scan_keyid],al
|
||||||
call draw_window
|
call draw_window
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
@ -55,61 +57,56 @@ still:
|
|||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; *********************************************
|
; *********************************************
|
||||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||||
; *********************************************
|
; *********************************************
|
||||||
|
|
||||||
|
|
||||||
draw_window:
|
draw_window:
|
||||||
|
; function 12:tell os about windowdraw ; 1, start of draw
|
||||||
|
mcall 12,1
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
|
||||||
mov ebx,1 ; 1, start of draw
|
|
||||||
mcall
|
|
||||||
|
|
||||||
; DRAW WINDOW
|
; DRAW WINDOW
|
||||||
mov eax,0 ; function 0 : define and draw window
|
mov eax,0 ; function 0 : define and draw window
|
||||||
mov ebx,100*65536+270 ; [x start] *65536 + [x size]
|
mov ebx,100*65536+270 ; [x start] *65536 + [x size]
|
||||||
mov ecx,100*65536+80 ; [y start] *65536 + [y size]
|
mov ecx,100*65536+100 ; [y start] *65536 + [y size]
|
||||||
mov edx,0x34ffffff ; color of work area RRGGBB,8->color gl
|
mov edx,0x34ffffff ; color of work area RRGGBB,8->color gl
|
||||||
mov edi,title
|
mov edi,title
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
mov eax,4 ; function 4 : write text to window
|
; function 4 : write text to window
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
mov esi,4
|
mcall 4,<33,8>,,text1,6
|
||||||
mov ebx,8*65536+8
|
mcall ,<85,8>,,text2,9
|
||||||
mov edx,tdec
|
mcall ,<8,28>,,tdec,4
|
||||||
mcall
|
add ebx,23
|
||||||
add ebx,23
|
mcall ,,,thex
|
||||||
mov edx,thex
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ecx,[keyid]
|
movzx ecx,byte [keyid]
|
||||||
mov eax,47
|
mcall 47,0x30000,,<40,28>,0x224466
|
||||||
mov ebx,3*65536
|
add edx,23
|
||||||
mov edx,40*65536+8
|
mov bh,1
|
||||||
mov esi,0x224466
|
mcall
|
||||||
mcall
|
|
||||||
add edx,23
|
|
||||||
mov bh,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
mov bh,0
|
||||||
mov ebx,2 ; 2, end of draw
|
movzx ecx,byte [scan_keyid]
|
||||||
mcall
|
mcall ,,,<100,28>
|
||||||
|
add edx,23
|
||||||
|
mov bh,1
|
||||||
|
mcall
|
||||||
|
|
||||||
ret
|
; function 12:tell os about windowdraw ; 2, end of draw
|
||||||
|
mcall 12,2
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
|
text1: db 'ASCII:'
|
||||||
tdec: db 'DEC:'
|
text2: db 'SCANCODE:'
|
||||||
thex: db 'HEX:'
|
tdec: db 'DEC:'
|
||||||
title db 'KEYBOARD ASCIICODES-PRESS ANY KEY',0
|
thex: db 'HEX:'
|
||||||
keyid: db 0
|
title: db 'KEYBOARD ASCIICODES-PRESS ANY KEY',0
|
||||||
I_END:
|
I_END:
|
||||||
|
keyid: rb 1
|
||||||
|
scan_keyid: rb 1
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user