'te_syntax' add keyboard

git-svn-id: svn://kolibrios.org@2819 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2012-06-23 10:20:38 +00:00
parent ec6526f177
commit 089bbf2a0a

View File

@@ -10,7 +10,7 @@ use32
dd sys_path
MAX_COLOR_WORD_LEN equ 40
BUF_SIZE equ 1000 ;buffer for copy|paste
BUF_SIZE equ 4096 ;buffer for copy|paste
maxSyntaxFileSize equ 310000
CAPT_PATH_WIDTH equ 50 ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>। ⥪<><EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD>
@@ -26,24 +26,21 @@ include 'te_work.inc' ;text work functions
align 4
start:
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
mcall 48,3,sc,sizeof.system_colors
mcall 68,11
or eax,eax
jz button.exit
mcall 68,11
or eax,eax
jz button.exit
mcall 40,0x27
mcall 66,1,1 ;scan code
mcall 40,0x27
;-------------------------------------------------
mov ecx,maxSyntaxFileSize
stdcall mem.Alloc,ecx
mov [options_file],eax
mov [options_file_end],eax
add [options_file_end],ecx
mov ecx,maxSyntaxFileSize
stdcall mem.Alloc,ecx
mov [options_file],eax
mov [options_file_end],eax
add [options_file_end],ecx
load_libraries l_libs_start,load_lib_end
@@ -223,13 +220,69 @@ mouse:
stdcall [ted_mouse], tedit0
jmp still
;output:
; ah = symbol
align 4
proc KeyConvertToASCII, table:dword
push ebx
mov ebx,dword[table] ;convert scan to ascii
ror ax,8
xor ah,ah
add bx,ax
mov ah,byte[ebx]
pop ebx
ret
endp
align 4
key:
mcall 66,3 ;66.3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
xor esi,esi
mov ecx,1
test al,0x03 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
@@:
test al,0x0c ;[Ctrl]
jz @f
or esi,KM_CTRL
@@:
test al,0x30 ;[Alt]
jz @f
mov cl,3
or esi,KM_ALT
@@:
test al,0x80 ;[NumLock]
jz @f
or esi,KM_NUMLOCK
@@:
mcall 26,2,,conv_tabl ;26.2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mcall 2
stdcall [tl_key],tree1
stdcall [edit_box_key],edit1
;;;stdcall [ted_key], tedit0, conv_tabl,esi
test word [edit1.flags],10b;ed_focus ; <20><20><> <20><><E4AEAA><EFBFBD>, <20><><EFBFBD><E5AEA4>
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, dword conv_tabl
stdcall [edit_box_key],edit1
jmp still
@@:
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
align 4
@@ -312,7 +365,8 @@ get_wnd_in_focus:
;@@:
ret
hed db 'TextEditor syntax file converter 06.09.11',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
hed db 'TextEditor syntax file converter 23.06.12',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
conv_tabl rb 128 ; ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> scan-<2D><><EFBFBD><EFBFBD> <20> ascii-<2D><><EFBFBD>
txt122 db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
txt148 db '<27><><EFBFBD><EFBFBD>. 䠩<>',0