Subversion Repositories Kolibri OS

Rev

Rev 1829 | Rev 3014 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1829 Rev 1900
Line 66... Line 66...
66
	jz	close_app
66
	jz	close_app
67
	stdcall dll.Load,importTable
67
	stdcall dll.Load,importTable
68
	test	eax, eax
68
	test	eax, eax
69
	jnz	close_app
69
	jnz	close_app
Line 70... Line -...
70
 
-
 
71
	; Get memory for editboxes text
70
 
72
	mcall	68, 12, MAX_HOTKEYS_NUM*PATH_MAX_CHARS
71
	mcall	68, 12, MAX_HOTKEYS_NUM*PATH_MAX_CHARS	 ; Get memory for editboxes text
73
	mov	dword [buf_cmd_line], eax
72
	mov	dword [buf_cmd_line], eax
74
	mov	dword [edit1.text],   eax
73
	mov	dword [edit1.text],   eax
75
	mcall	68, 12, MAX_HOTKEYS_NUM*PATH_MAX_CHARS
74
	mcall	68, 12, MAX_HOTKEYS_NUM*PATH_MAX_CHARS
76
	mov	dword [buf_cmd_params], eax
75
	mov	dword [buf_cmd_params], eax
Line 131... Line 130...
131
key:
130
key:
132
	mcall	2
131
	mcall	2
Line 133... Line 132...
133
 
132
 
134
	push	eax
133
	push	eax
-
 
134
	mcall	66, 3
-
 
135
	;mov     edx, eax
135
	mcall	66, 3
136
	;and     edx, 0x00000FF;F
136
	mov	dword [modifiers], eax
137
	mov	dword [modifiers], eax;edx
Line 137... Line 138...
137
	pop	eax
138
	pop	eax
138
 
139
 
139
	test	word [edit1.flags], 10b
140
	test	word [edit1.flags], 10b
Line 169... Line 170...
169
	mov	cl, byte [hotkeys_num]
170
	mov	cl, byte [hotkeys_num]
170
     .test_next_hotkey:
171
     .test_next_hotkey:
171
	dec	cl
172
	dec	cl
172
	mov	bl, cl
173
	mov	bl, cl
173
	and	ebx, 0xFF
174
	and	ebx, 0xFF
174
	shl	ebx, 2
175
	shl	ebx, 2;5
-
 
176
;        mov     esi, ebx
175
	add	ebx, dword Hotkeys.codes
177
	add	ebx, dword Hotkeys.codes
Line 176... Line 178...
176
 
178
 
177
	mov	edx, dword [ebx]
179
	mov	edx, dword [ebx]
178
	cmp	ah, dl
180
	cmp	ah, dl
Line 345... Line 347...
345
 
347
 
346
Load_HotkeyList:
348
Load_HotkeyList:
Line 347... Line 349...
347
	call	ReadIni
349
	call	ReadIni
348
 
-
 
349
	mov	al, byte [butt]
-
 
350
	mov	ah, byte [hotkeys_num]
-
 
351
	cmp	al, ah
-
 
352
	jle	@f
-
 
353
	mov	al, ah
350
 
354
      @@:
351
	mov	al, byte [butt]
355
	and	eax, 0xFF
352
	and	eax, 0xFF
356
	sub	al, FIRST_ITEM_BUTTON_ID
353
	sub	al, FIRST_ITEM_BUTTON_ID
357
	mov	cl, byte PATH_MAX_CHARS
354
	mov	cl, byte PATH_MAX_CHARS
358
	mul	cl
355
	mul	cl
359
	mov	ebx, eax
356
	mov	ebx, eax
Line -... Line 357...
-
 
357
	add	eax, dword [buf_cmd_line]
360
	add	eax, dword [buf_cmd_line]
358
	add	ebx, dword [buf_cmd_params]
361
	add	ebx, dword [buf_cmd_params]
359
 
362
 
360
 
363
 
361
	;mov  [butt], FIRST_ITEM_BUTTON_ID
Line 541... Line 539...
541
 
539
 
542
it_test_key_modifiers:
540
it_test_key_modifiers:
543
	push	eax
541
	push	eax
544
	mcall	66, 3 ;get control keys state
542
	mcall	66, 3 ;get control keys state
-
 
543
	mov	edx,  eax
545
	mov	edx,  eax
544
	;and     edx,  0x00000FFF
546
      .lshift:
545
      .lshift:
547
	test	al, 1  ; LShift ?
546
	test	al, 1  ; LShift ?
548
	jz	.rshift
547
	jz	.rshift
549
	stdcall outtextxy, 10, 100, ctrl_key_names, 6, A_TEXTCOLOR
548
	stdcall outtextxy, 10, 100, ctrl_key_names, 6, A_TEXTCOLOR
Line 593... Line 592...
593
	call	strncat
592
	call	strncat
Line 594... Line 593...
594
 
593
 
595
	mov	esi, aPlus
594
	mov	esi, aPlus
596
	mov	ecx, 3
595
	mov	ecx, 3
-
 
596
	call	strncat
597
	call	strncat
597
	;stdcall outtextxy, 10, 100, ctrl_key_names, 6, 0x00FF0000
598
      .rshift:
598
      .rshift:
599
	test	al, 2  ; RShift ?
599
	test	al, 2  ; RShift ?
600
	jz	.lctrl
600
	jz	.lctrl
601
	mov	esi, ctrl_key_names+29
601
	mov	esi, ctrl_key_names+29
602
	mov	ecx, 6
602
	mov	ecx, 6
Line 603... Line 603...
603
	call	strncat
603
	call	strncat
604
 
604
 
605
	mov	esi, aPlus
605
	mov	esi, aPlus
-
 
606
	mov	ecx, 3
606
	mov	ecx, 3
607
	call	strncat
607
	call	strncat
608
	;stdcall outtextxy, 184, 100, ctrl_key_names+29, 6, 0x00FF0000
608
      .lctrl:
609
      .lctrl:
609
	test	al, 4  ; LCtrl ?
610
	test	al, 4  ; LCtrl ?
610
	jz	.rctrl
611
	jz	.rctrl
611
	mov	esi, ctrl_key_names+7
612
	mov	esi, ctrl_key_names+7
Line 612... Line 613...
612
	mov	ecx, 5
613
	mov	ecx, 5
613
	call	strncat
614
	call	strncat
614
 
615
 
-
 
616
	mov	esi, aPlus
615
	mov	esi, aPlus
617
	mov	ecx, 3
616
	mov	ecx, 3
618
	call	strncat
617
	call	strncat
619
	;stdcall outtextxy, 52, 100, ctrl_key_names+7, 5, 0x00FF0000
618
      .rctrl:
620
      .rctrl:
619
	test	al, 8  ; RCtrl ?
621
	test	al, 8  ; RCtrl ?
620
	jz	.lalt
622
	jz	.lalt
Line 621... Line 623...
621
	mov	esi, ctrl_key_names+23
623
	mov	esi, ctrl_key_names+23
622
	mov	ecx, 5
624
	mov	ecx, 5
623
	call	strncat
625
	call	strncat
-
 
626
 
624
 
627
	mov	esi, aPlus
625
	mov	esi, aPlus
628
	mov	ecx, 3
626
	mov	ecx, 3
629
	call	strncat
627
	call	strncat
630
	;stdcall outtextxy, 148, 100, ctrl_key_names+23, 5, 0x00FF0000
628
      .lalt:
631
      .lalt:
629
	test	al, 0x10  ; LAlt ?
632
	test	al, 0x10  ; LAlt ?
Line 630... Line 633...
630
	jz	.ralt
633
	jz	.ralt
631
	mov	esi, ctrl_key_names+13
634
	mov	esi, ctrl_key_names+13
632
	mov	ecx, 4
635
	mov	ecx, 4
-
 
636
	call	strncat
633
	call	strncat
637
 
634
 
638
	mov	esi, aPlus
635
	mov	esi, aPlus
639
	mov	ecx, 3
636
	mov	ecx, 3
640
	call	strncat
637
	call	strncat
641
	;stdcall outtextxy, 88, 100, ctrl_key_names+13, 4, 0x00FF0000
638
      .ralt:
642
      .ralt:
Line 639... Line 643...
639
	test	al, 0x20  ; RAlt ?
643
	test	al, 0x20  ; RAlt ?
640
	jz	@f
644
	jz	@f
641
	mov	esi, ctrl_key_names+18
645
	mov	esi, ctrl_key_names+18
-
 
646
	mov	ecx, 4
642
	mov	ecx, 4
647
	call	strncat
643
	call	strncat
648
 
644
 
649
	mov	esi, aPlus
645
	mov	esi, aPlus
650
	mov	ecx, 3
646
	mov	ecx, 3
651
	call	strncat
647
	call	strncat
652
	;stdcall outtextxy, 118, 100, ctrl_key_names+18, 4, 0x00FF0000
Line -... Line 653...
-
 
653
      @@:
-
 
654
	mov	esi, it_ascii_keymap
-
 
655
	and	edx, 0xFF
-
 
656
	add	esi, edx
-
 
657
	mov	ecx, 1
-
 
658
	call	strncat
648
      @@:
659
 
649
	mov	esi, it_ascii_keymap
660
	if 1;DEBUG
Line 650... Line 661...
650
	and	edx, 0xFF
661
	  mov	  esi, edi;Hotkeys.code_names
Line 893... Line 904...
893
 
904
 
Line 894... Line 905...
894
; DATA AREA
905
; DATA AREA
895
 
906
 
896
; Application Title
907
; Application Title
Line 897... Line 908...
897
labelt		db	'MyKey v.0.2'
908
labelt		db	'MyKey v.0.2'
Line 898... Line 909...
898
mykey_window	dd	0	   ; Slot number of MyKey main thread
909
mykey_window	dd	0	   ; Slot number of MyKey
Line 919... Line 930...
919
;DeleteKeyText   db 'Delete',0
930
;DeleteKeyText   db 'Delete',0
920
;ManageKeyText   db 'Manage',0
931
;ManageKeyText   db 'Manage',0
Line 921... Line 932...
921
 
932
 
-
 
933
 
922
 
934
hotkeys_num   db 0;15
923
hotkeys_num   db 0;15
935
;keyboard_mode db 0       ; Scan or ASCII keys to send ?  0 - ASCII , 1 - Scan
Line 924... Line 936...
924
butt	      db FIRST_ITEM_BUTTON_ID	    ; Pressed button ID
936
butt	      db FIRST_ITEM_BUTTON_ID	    ; Pressed button ID
925
modifiers     dd 0
937
modifiers     dd 0
926
 
938
 
Line 927... Line 939...
927
;Data structures for loadlib.mac and editbox_ex.mac [
939
;Data structures for loadlib.mac and editbox_ex.mac [
928
edit1 edit_box 350, 220, 30, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, PATH_MAX_CHARS+1, buf_cmd_line, 0, 0
940
edit1 edit_box 350, 220, 30, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, PATH_MAX_CHARS+1, buf_cmd_line, 0, 0
Line 929... Line 941...
929
edit2 edit_box 350, 220, 50, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, PATH_MAX_CHARS+1, buf_cmd_params, 0, 0
941
edit2 edit_box 350, 220, 50, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, PATH_MAX_CHARS+1, buf_cmd_params, 0, 0
930
 
942
 
931
buf_cmd_line   dd 0
943
buf_cmd_line   dd 0 ;db MAX_HOTKEYS_NUM*PATH_MAX_CHARS dup(0)  ; !Make it dynamic!!!
Line 955... Line 967...
955
 
967
 
956
align 16
968
align 16
957
importTable:
969
importTable:
958
library 						\
970
library 						\
959
	libini, 'libini.obj';,                           \
971
	libini, 'libini.obj';,                           \
-
 
972
;        boxlib, 'boxlib.obj',                           \
Line 960... Line 973...
960
;        boxlib, 'boxlib.obj'                            \
973
;        libio, 'libio.obj',                            \
961
 
974
 
962
;import  boxlib, \
975
;import  boxlib, \
963
;edit_box_draw  , 'edit_box', \
976
;edit_box_draw  , 'edit_box', \
Line 1008... Line 1021...
1008
aRamSaver      db  '/sys/rdsave',0
1021
aRamSaver      db  '/sys/rdsave',0
Line 1009... Line 1022...
1009
 
1022
 
1010
app_path       rb  255
1023
app_path       rb  255
Line 1011... Line 1024...
1011
ini_path       rb  255
1024
ini_path       rb  255
1012
 
1025
 
1013
Hotkeys:  ;(name = 32 b) + (modifiers = 3 b) + (keycode = 1 b) + (keycode_name = 64 b) = 100 bytes for 1 hotkey
1026
Hotkeys:  ;(name = 32 b) + (modifiers = 3 b) + (keycode = 1 b) = 36 byte for 1 hotkey
1014
    .names:
1027
    .names:
1015
	     db 'My1',0
1028
	     db 'My1',0
1016
	     rb 28
1029
	     rb 28