Hotkeys are now supported

git-svn-id: svn://kolibrios.org@92 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2006-06-30 12:23:15 +00:00
parent c1783c769f
commit 56d23ae060
5 changed files with 445 additions and 201 deletions

View File

@ -733,6 +733,40 @@ terminate: ; terminate application
mov [0xf500],byte 0 ; empty button buffer
; remove defined hotkeys
mov eax, hotkey_list
.loop:
cmp [eax+8], esi
jnz .cont
mov ecx, [eax]
jecxz @f
push dword [eax+12]
pop dword [ecx+12]
@@:
mov ecx, [eax+12]
push dword [eax]
pop dword [ecx]
xor ecx, ecx
mov [eax], ecx
mov [eax+4], ecx
mov [eax+8], ecx
mov [eax+12], ecx
.cont:
add eax, 16
cmp eax, hotkey_list+256*16
jb .loop
; remove hotkeys in buffer
mov eax, hotkey_buffer
.loop2:
cmp [eax], esi
jnz .cont2
and dword [eax+4], 0
and dword [eax], 0
.cont2:
add eax, 8
cmp eax, hotkey_buffer+120*8
jb .loop2
mov ecx,esi ; remove buttons
bnewba2:
mov edi,[0xfe88]
@ -764,13 +798,11 @@ terminate: ; terminate application
add esi,window_data
mov ax,[esi+0]
mov word [dlx],ax
mov bx,[esi+8]
add ax,bx
add ax,[esi+8]
mov word [dlxe],ax
mov ax,[esi+4]
mov word [dly],ax
mov bx,[esi+12]
add ax,bx
add ax,[esi+12]
mov word [dlye],ax
mov [esi+0],word 0
mov [esi+8],word 5
@ -798,18 +830,11 @@ terminate: ; terminate application
mov edi,esi
shl edi,5
add edi,window_data
mov [edi+4],eax
mov [edi+4+window_data],eax
popa
pusha
mov edi,esi
shl edi,5
add edi,draw_data
mov ecx,32/4
xor eax, eax
; cld
rep stosd
popa
@ -864,30 +889,34 @@ terminate: ; terminate application
nlc41:
popa
pusha ; remove hd1 reservation
mov edx,esi
shl edx, 5 ;imul edx,0x20
add edx,0x3000
mov edx,[edx+4]
cmp [hd1_status],edx
jne no_hd1_s_remove
push esi ; remove hd1 & cd & flp reservation
shl esi, 5
mov esi, [esi+0x3004]
cmp [hd1_status], esi
jnz @f
mov [hd1_status], 0
no_hd1_s_remove:
popa
@@:
cmp [cd_status], esi
jnz @f
mov [cd_status], 0
@@:
cmp [flp_status], esi
jnz @f
mov [flp_status], 0
@@:
pop esi
pusha ; remove all irq reservations
mov edx,esi
shl edx, 5 ;imul edx,0x20
add edx,0x3000
mov edx,[edx+4]
mov eax,esi
shl eax, 5 ;imul edx,0x20
mov eax,[edx+0x3000+4]
mov edi,irq_owner
mov ecx,16
newirqfree:
cmp [edi],edx
scasd
jne nofreeirq
mov [edi],dword 0
mov [edi-4],dword 0
nofreeirq:
add edi,4
loop newirqfree
popa

View File

@ -127,15 +127,19 @@
* ¥á«¨ ¡ãä¥à ¯ãáâ, ¢®§¢à é ¥âáï eax=1
* ¥á«¨ ¡ãä¥à ­¥¯ãáâ, â® ¢®§¢à é ¥âáï al=0, ah=ª®¤ ­ ¦ â®© ª« ¢¨è¨,
áâ à襥 á«®¢® ॣ¨áâà  eax ®¡­ã«¥­®
* ¥á«¨ ¥áâì "£®àïç ï ª« ¢¨è ", â® ¢®§¢à é ¥âáï
al=2, ah=᪠­ª®¤ ­ ¦ â®© ª« ¢¨è¨ (0 ¤«ï ã¯à ¢«ïîé¨å ª« ¢¨è),
áâ à襥 á«®¢® ॣ¨áâà  eax ᮤ¥à¦¨â á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
¢ ¬®¬¥­â ­ ¦ â¨ï £®àï祩 ª« ¢¨è¨
‡ ¬¥ç ­¨ï:
* ‘ãé¥áâ¢ã¥â ®¡é¥á¨á⥬­ë© ¡ãä¥à ­ ¦ âëå ª« ¢¨è à §¬¥à®¬ 120 ¡ ©â,
®à£ ­¨§®¢ ­­ë© ª ª ®ç¥à¥¤ì.
* ‘ãé¥áâ¢ã¥â ¥éñ ®¤¨­ ®¡é¥á¨á⥬­ë© ¡ãä¥à ­  120 "£®àïç¨å ª« ¢¨è".
* <20>ਠ¢ë§®¢¥ í⮩ ä㭪樨 ¯à¨«®¦¥­¨¥¬ á ­¥ ªâ¨¢­ë¬ ®ª­®¬
¢®§¢à é ¥âáï ®â¢¥â "¡ãä¥à ¯ãáâ".
* <20>â  äã­ªæ¨ï ­¥ á®®¡é ¥â ® ª« ¢¨è å, ­ ¦ âëå ¢ ª®¬¡¨­ æ¨¨ á Alt,
¤«ï â ª¨å á«ãç ¥¢ ¥áâì ¯®¤äã­ªæ¨ï 12 ä㭪樨 18.
áç¨â ¥âáï, çâ® ¡ãä¥à ­ ¦ âëå ª« ¢¨è ¯ãáâ.
* <20>® 㬮«ç ­¨î íâ  äã­ªæ¨ï ¢®§¢à é ¥â ASCII-ª®¤ë; ¯¥à¥ª«îç¨âìáï ­ 
०¨¬ ᪠­ª®¤®¢ (¨ ­ § ¤) ¬®¦­® á ¨á¯®«ì§®¢ ­¨¥¬ ä㭪樨 66.
Ž¤­ ª®, £®àï稥 ª« ¢¨è¨ ¢á¥£¤  ¢®§¢à é îâáï ª ª ᪠­ª®¤ë.
* “§­ âì, ª ª¨¥ ª®¬¡¨­ æ¨¨ ª« ¢¨è ᮮ⢥âáâ¢ãîâ ª ª¨¬ ª®¤ ¬, ¬®¦­®,
§ ¯ãá⨢ ¯à¨«®¦¥­¨ï keyascii ¨ scancode.
* ‘ª ­ª®¤ë ¢®§¢à é îâáï ­¥¯®á।á⢥­­® ª« ¢¨ âãன ¨ 䨪á¨à®¢ ­ë;
@ -144,6 +148,8 @@
¯®¤ä㭪樥© 2 ä㭪樨 26.
* Š ª á«¥¤á⢨¥, ASCII-ª®¤ë ãç¨â뢠îâ ⥪ãéãî à áª« ¤ªã ª« ¢¨ âãàë
(rus/en) ¢ ®â«¨ç¨¥ ®â ᪠­ª®¤®¢.
* <20>®áâ㯠¥â ¨­ä®à¬ æ¨ï ⮫쪮 ® â¥å £®àïç¨å ª« ¢¨è å, ª®â®àë¥ ¡ë«¨
®¯à¥¤¥«¥­ë í⨬ ¯®â®ª®¬ ¯®¤ä㭪樥© 4 ä㭪樨 66.
======================================================================
================ ”ã­ªæ¨ï 3 - ¯®«ãç¨âì á¨á⥬­®¥ ¢à¥¬ï. ===============
@ -826,48 +832,6 @@
¥áâ¥á⢥­­®, ¡ã¤¥â ¤à㣮©, ­® ¯¥à¢ë¥ ¤¢  ¯®«ï
á®åà ­ïâáï ­¥¨§¬¥­­ë¬¨.
======================================================================
=== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 12 - ¯®«ãç¨âì ¯®á«¥¤­îî ­ ¦ âãî ª« ¢¨èã. ==
======================================================================
<EFBFBD> à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 12 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* al = ०¨¬ ¢¢®¤  á ª« ¢¨ âãàë (0=ASCII,1=᪠­ª®¤ë), ª®â®àë©
¨¬¥« ¬¥áâ® ¯à¨ ®¡à ¡®âª¥ ­ ¦ â¨ï ¯®á«¥¤­¥© ª« ¢¨è¨ ­  ª« ¢¨ âãà¥
* ah = ª®¤ ¯®á«¥¤­¥© ­ ¦ â®© ª« ¢¨è¨
* áâ à襥 á«®¢® ॣ¨áâà  eax ®¡­ã«¥­®
‡ ¬¥ç ­¨ï:
* ’®«ìª® íâ  äã­ªæ¨ï ¯®§¢®«ï¥â áç¨â뢠âì ª« ¢¨è¨, ¢® ¢à¥¬ï
áç¨â뢠­¨ï ª®â®àëå ¨§ ¡ãä¥à  ¡ë«  ­ ¦ â  ª« ¢¨è  Alt, äã­ªæ¨ï 2
¢ á«ãç ¥, ª®£¤  ¯à¨ ¥ñ ¢ë§®¢¥ ¡ë«  ­ ¦ â  Alt, ¢®§¢à é ¥â
"¡ãä¥à ¯ãáâ", ⥬ ­¥ ¬¥­¥¥ áç¨âë¢ ï ª« ¢¨èã ¨§ ®ç¥à¥¤¨ ¢
£«®¡ «ì­ãî á¨á⥬­ãî ¯¥à¥¬¥­­ãî last_key_press ¨ ¯à®¤¢¨£ ï ®ç¥à¥¤ì
¢¯¥àñ¤.
* <20>®á«¥ áç¨â뢠­¨ï ª®¤ ¯®á«¥¤­¥© ­ ¦ â®© ª« ¢¨è¨ á¡à á뢠¥âáï ¢ 0.
‘«¥¤®¢ â¥«ì­®, ­¥ á⮨⠨ᯮ«ì§®¢ âì íâã äã­ªæ¨î ¢ ¤¢ãå à §«¨ç­ëå
¯à®£à ¬¬ å (¨ ¤ ¦¥ ¤¢  à §  ¢ ®¤­®© ¯à®£à ¬¬¥).
* <20>ਫ®¦¥­¨¥ @panel ¨á¯®«ì§ã¥â íâã äã­ªæ¨î ¤«ï ॠ£¨à®¢ ­¨ï
­  Alt+F4, Alt+Win, Alt+Ctrl+F12.
* last_key_press ®¡­®¢«ï¥âáï ¢ â®ç­®á⨠¢ á«¥¤ãîé¨å á«ãç ïå:
* Ž¡­ã«ï¥âáï ¯à¨ ¢ë§®¢¥ ®¯¨á뢠¥¬®© ä㭪樨.
* Š®£¤  ã¯à ¢«¥­¨¥ ¯®«ã砥⠭¥ª®â®à ï ¯à®æ¥¤ãà 
(main_loop_sys_getkey) £« ¢­®£® 横«  ®¯¥à æ¨®­­®© á¨á⥬ë:
¥á«¨ ¡ãä¥à ­¥¯ãáâ, â® ¯¥à¢ ï ª« ¢¨è  ¡ãä¥à  ª®¯¨àã¥âáï ¢
last_key_press (¨ ­¥ § ¡¨à ¥âáï ¨§ ®ç¥à¥¤¨).
* <20>ਠ¢ë§®¢¥ ä㭪樨 2: ¥á«¨ ¡ãä¥à ­¥¯ãáâ, â® áç¨â ­­ ï ª« ¢¨è 
ª®¯¨àã¥âáï ¢ last_key_press (¨ ¢®§¢à é ¥âáï ¯à¨«®¦¥­¨î,
¢ë§¢ ¢è¥¬ã äã­ªæ¨î 2, ­® ⮫쪮 ¥á«¨ ¢ ¬®¬¥­â áç¨â뢠­¨ï
­¥ ­ ¦ â  Alt).
* <20>®áª®«ìªã ¯à¨  ªâ¨¢¨§ æ¨¨ ®ª­  á¡à á뢠îâáï ®ç¥à¥¤¨ ª« ¢¨è ¨
ª­®¯®ª, â® ¢ ¡®«ì設á⢥ á«ãç ¥¢ ¨­â¥à¯à¥â æ¨ï ah ᮮ⢥âáâ¢ã¥â al
(â.¥. ¯®­ïâ­®, çâ® åà ­¨âáï ¢ ah - ASCII-ª®¤ ¨«¨ ᪠­ª®¤).
’¥¬ ­¥ ¬¥­¥¥ ¢®§¬®¦­ë ­¥¯à¨ïâ­ë¥ á«ãç ¨, ª®£¤   ªâ¨¢­®¥ ®ª­®,
­¥ § ¡®âïáì ®¡ ®áâ ¢è¨åáï ¢ ¡ãä¥à¥ ª« ¢¨è å, ¢ë§ë¢ ¥â äã­ªæ¨î 66,
¯¥à¥ª«îç ïáì ¬¥¦¤ã ०¨¬ ¬¨; ¥á«¨ ¯®á«¥ í⮣® ¯®«ì§®¢ â¥«ì ­ ¦¬ñâ
­  ª« ¢¨èã, â® §­ ç¥­¨¥ ¯¥à¥¬¥­­®©, ᮮ⢥âáâ¢ãî饩 al, ¨§¬¥­¨âáï,
  ­ ç «ì­ë¥ ª« ¢¨è¨ ¢ ¡ãä¥à¥ ®áâ ­ãâáï ¢ áâ à®¬ ०¨¬¥.
======================================================================
========== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 13 - ¯®«ãç¨âì ¢¥àá¨î ï¤à . =========
======================================================================
@ -1028,9 +992,6 @@ db 'Kolibri',0
­®à¬ «ì­ ï à áª« ¤ª , ¯®á«¥ 祣® ¨§ ª®¤  ¢ëç¨â ¥âáï 0x60;
¥á«¨ ­¥ ­ ¦ â  ­¨ ®¤­  ¨§ ã¯à ¢«ïîé¨å ª« ¢¨è, â® ¨á¯®«ì§ã¥âáï
­®à¬ «ì­ ï à áª« ¤ª .
* –¥­­®áâì ãáâ ­®¢ª¨ à áª« ¤ª¨ á Alt ¯à¥¤áâ ¢«ï¥âáï ᮬ­¨â¥«ì­®©,
¯®áª®«ìªã ¢áñ à ¢­® äã­ªæ¨ï 2 ­¥ ¢®§¢à é ¥â ª« ¢¨è¨ ¯à¨
­ ¦ â®¬ Alt.
* <20>®«ãç¨âì à áª« ¤ª¨ ¨ ¨¤¥­â¨ä¨ª â®à áâà ­ë ¬®¦­® á ¯®¬®éìî
¯®¤ä㭪樨 2 ä㭪樨 26.
* ˆ¤¥­â¨ä¨ª â®à áâà ­ë - £«®¡ «ì­ ï á¨á⥬­ ï ¯¥à¥¬¥­­ ï, ª®â®à ï
@ -3188,6 +3149,55 @@ dword-
¢ § ¬®à®¦¥­­®¬ á®áâ®ï­¨¨; ¤«ï § ¯ã᪠ ¨á¯®«ì§ã©â¥
¯®¤äã­ªæ¨î 5 ä㭪樨 69.
======================================================================
=== ”ã­ªæ¨ï 59 - ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯®á«¥¤­¨å á¨á⥬­ëå ¢ë§®¢ å. ==
======================================================================
<EFBFBD>®«ã砥⠤ ­­ë¥ ® ¢á¥å á¨á⥬­ëå ¢ë§®¢ å ¢á¥å ¯à®æ¥áᮢ.
<EFBFBD> à ¬¥âàë:
* eax = 59 - ­®¬¥à ä㭪樨
* ebx = 0 - ¥¤¨­á⢥­­ ï ¯®¤äã­ªæ¨ï
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à
* edx = à §¬¥à ¡ãä¥à 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ®¡é¥¥ ç¨á«® á¨á⥬­ëå ¢ë§®¢®¢,
ᤥ« ­­ëå á ¬®¬¥­â  § £à㧪¨ á¨á⥬ë (¯® ¬®¤ã«î 2^32)
* ebx = 0
”®à¬ â ¨­ä®à¬ æ¨¨ ®¡ ®¤­®¬ ¢ë§®¢¥: (à §¬¥à = 0x40 = 64 ¡ ©â )
* +0: dword: PID ¯à®æ¥áá /¯®â®ª 
* +4: 7*dword: ¬ãá®à
* +32 = +0x20: dword: §­ ç¥­¨¥ edi ¯à¨ ¢ë§®¢¥
* +36 = +0x24: dword: esi
* +40 = +0x28: dword: ebp
* +44 = +0x2C: dword: 㪠§ â¥«ì áâíª  ®¡à ¡®â稪  ï¤à 
* +48 = +0x30: dword: ebx
* +52 = +0x34: dword: edx
* +56 = +0x38: dword: ecx
* +60 = +0x3C: dword: eax (=­®¬¥à á¨á⥬­®© ä㭪樨)
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ¨á¯®«ì§ã¥âáï ⮫쪮 ¢ ¯à¨«®¦¥­¨¨ systrace.
„®¢®«ì­® âà㤭® ¯à¥¤áâ ¢¨âì á¨âã æ¨î, ¢ ª®â®à®© íâ® ¯à¨«®¦¥­¨¥
¨«¨ íâ  äã­ªæ¨ï ¤¥©á⢨⥫쭮 ¯®«¥§­ë,   ¢®â ¢á¥ á¨á⥬­ë¥ ¢ë§®¢ë
¤«ï ¯®¤¤¥à¦ª¨ í⮩ ä㭪樨 ­¥áª®«ìª® § ¬¥¤«ïîâáï
(å®âï ¨ ­¥­ ¬­®£®)...
* á¢ï§¨ á í⨬ ¥áâì ¯à¥¤«®¦¥­¨¥ ¯®¤¤¥à¦ªã í⮩ ä㭪樨
¨§ ï¤à  ã¡à âì ᮢᥬ, ¢¬¥áâ¥ á ¯à¨«®¦¥­¨¥¬ systrace.
* ˆ­ä®à¬ æ¨ï ® á¨á⥬­ëå ¢ë§®¢ å á®åà ­ï¥âáï ¢
á¨á⥬­®¬ ª®«ì楢®¬ ¡ãä¥à¥ ­  0x10 ¢å®¤®¢.
<20>â  äã­ªæ¨ï ¯à®áâ® ª®¯¨àã¥â 㪠§ ­­ë© ®¡êñ¬ ¤ ­­ëå
¨§ 㯮¬ï­ã⮣® ¡ãä¥à  ¯® 㪠§ ­­®¬ã  ¤à¥áã.
* Š ª®© ¨§ ¢å®¤®¢ ¢ ¡ãä¥à¥ ᮮ⢥âáâ¢ã¥â ¯®á«¥¤­¥¬ã ¢ë§®¢ã,
¬®¦­® ®¯à¥¤¥«¨âì ¯® §­ ç¥­¨î eax,   ¨¬¥­­®,
¢å®¤ (eax and 0xF) (¯® ᬥ饭¨î (eax and 0xF)*0x40).
* ⥪ã饩 ॠ«¨§ æ¨¨ ¢®§¬®¦­ë ।ª® ¢áâà¥ç î騥áï
¯à®¡«¥¬ë à áᨭåà®­¨§ æ¨¨, ª®£¤  ® ­¥ª®â®àëå ¢ë§®¢ å
¨­ä®à¬ æ¨ï ãáâ à¥¢ ¥â.
* <20>®¤ á¨á⥬­ë© ¡ãä¥à ¢ë¤¥«¥­  áâà ­¨æ , 4Š¡.
<20> §¬¥à ¢å®¤  = 64 ¡ ©â .
<20>®ç¥¬ã ¨á¯®«ì§ã¥âáï ⮫쪮 16 ¢å®¤®¢ - ­¥¯®­ïâ­®.
* ‡­ ç¥­¨¥ esp ¢ ¬®¬¥­â á¨á⥬­®£® ¢ë§®¢ 
í⮩ ä㭪樥© 㧭 âì ­¥«ì§ï.
* <20>஢¥àª¨ ª®à४⭮á⨠edx ¢ ⥪ã饩 ॠ«¨§ æ¨¨ ­¥ ¤¥« ¥âáï.
======================================================================
=========== ”ã­ªæ¨ï 60 - Inter Process Communication (IPC). ==========
======================================================================
@ -3392,6 +3402,8 @@ IPC
fff = ­®¬¥à ä㭪樨 ãáâனá⢠
* cl = ­®¬¥à ॣ¨áâà  (¤®«¦¥­ ¡ëâì çñâ­ë¬ ¤«ï bl=9,
¤¥«¨âìáï ­  4 ¤«ï bl=10)
* dl/dx/edx (¢ § ¢¨á¨¬®á⨠®â § ¯à®è¥­­®£® à §¬¥à ) ᮤ¥à¦¨â
¤ ­­ë¥ ¤«ï § ¯¨á¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ®è¨¡ª  (§ ¯à¥éñ­ ¤®áâ㯠ª PCI ¨«¨
­¥¯®¤¤¥à¦¨¢ ¥¬ë¥ ¯ à ¬¥âàë)
@ -3468,13 +3480,12 @@ IPC
¤¨­ ¬¨ç¥áª®£® ¢ë¤¥«¥­¨ï/®á¢®¡®¦¤¥­¨ï ¯ ¬ï⨠¯à¨«®¦¥­¨ï.
======================================================================
=========== ”ã­ªæ¨ï 66 - ०¨¬ ¯®«ã祭¨ï ¤ ­­ëå ª« ¢¨ âãàë. ==========
================= ”ã­ªæ¨ï 66 - à ¡®â  á ª« ¢¨ âãன. =================
======================================================================
<EFBFBD>¥¦¨¬ ¢¢®¤  ¢«¨ï¥â ­  १ã«ìâ âë ç⥭¨ï ª« ¢¨è ä㭪樥© 2
¨ ¯®«ã祭¨ï ¯®á«¥¤­¥© ­ ¦ â®© ª« ¢¨è¨ ¯®¤ä㭪樥© 12 ä㭪樨 18.
<EFBFBD>¥¦¨¬ ¢¢®¤  ¢«¨ï¥â ­  १ã«ìâ âë ç⥭¨ï ª« ¢¨è ä㭪樥© 2.
<EFBFBD>ਠ§ £à㧪¥ ¯à®£à ¬¬ë ¤«ï ­¥ñ ãáâ ­ ¢«¨¢ ¥âáï ASCII-०¨¬ ¢¢®¤ .
------------------ <20>®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì ०¨¬. ------------------
-------- <20>®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì ०¨¬ ¢¢®¤  á ª« ¢¨ âãàë. ---------
<EFBFBD> à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
@ -3484,7 +3495,7 @@ IPC
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
------------------- <20>®¤äã­ªæ¨ï 2 - ¯®«ãç¨âì ०¨¬. -------------------
--------- <20>®¤äã­ªæ¨ï 2 - ¯®«ãç¨âì ०¨¬ ¢¢®¤  á ª« ¢¨ âãàë. ----------
<EFBFBD> à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
@ -3508,6 +3519,52 @@ IPC
* ¡¨â 8 (¬ áª  0x100): ScrollLock ¢ª«îçñ­
* ¯à®ç¨¥ ¡¨âë á¡à®è¥­ë
----- <20>®¤äã­ªæ¨ï 4 - ãáâ ­®¢¨âì ®¡é¥á¨á⥬­ãî "£®àïçãî ª« ¢¨èã". -----
Ž ­ ¦ â¨¨ "£®àï祩 ª« ¢¨è¨" ¨§¢¥é îâáï ⮫쪮 ¯à¨«®¦¥­¨ï,
ãáâ ­®¢¨¢è¨¥ ¥ñ;  ªâ¨¢­®¥ ¯à¨«®¦¥­¨¥ (ª ª®â®à®¬ã ¯®áâ㯠¥â
¢¥áì ­®à¬ «ì­ë© ¢¢®¤) â ª¨å ª« ¢¨è ­¥ ¯®«ãç ¥â.
ˆ§¢¥é¥­¨¥ § ª«îç ¥âáï ¢ ¯®á뫪¥ ᮡëâ¨ï á ª®¤®¬ 2.
<EFBFBD>à®ç¨â âì "£®àïçãî ª« ¢¨èã" ¬®¦­® â ª ¦¥, ª ª ¨ ®¡ëç­ãî, -
ä㭪樥© 2.
<EFBFBD> à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* cl § ¤ ñâ ᪠­ª®¤ ª« ¢¨è¨;
¨á¯®«ì§ã©â¥ cl=0 ¤«ï § ¤ ­¨ï ª®¬¡¨­ æ¨© ⨯  Ctrl+Shift
* edx = 0xXYZ § ¤ ñâ ¢®§¬®¦­ë¥ á®áâ®ï­¨ï ã¯à ¢«ïîé¨å ª« ¢¨è:
* Z (¬« ¤è¨¥ 4 ¡¨â ) § ¤ ñâ á®áâ®ï­¨¥ ª« ¢¨è LShift ¨ RShift:
* 0 = ­¨ ®¤­  ¨§ ª« ¢¨è ­¥ ¤®«¦­  ¡ëâì ­ ¦ â ;
* 1 = ஢­® ®¤­  ¨§ ª« ¢¨è ¤®«¦­  ¡ëâì ­ ¦ â ;
* 2 = ®¡¥ ª« ¢¨è¨ ¤®«¦­ë ¡ëâì ­ ¦ âë;
* 3 = ¤®«¦­  ¡ëâì ­ ¦ â  LShift, ­® ­¥ RShift;
* 4 = ¤®«¦­  ¡ëâì ­ ¦ â  RShift, ­® ­¥ LShift
* Y -  ­ «®£¨ç­® ¤«ï LCtrl ¨ RCtrl;
* X -  ­ «®£¨ç­® ¤«ï LAlt ¨ RAlt
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax=0 - ãᯥ譮
* eax=1 - ᫨誮¬ ¬­®£® "£®àïç¨å ª« ¢¨è" (¤®¯ã᪠¥âáï ¬ ªá¨¬ã¬ 256)
‡ ¬¥ç ­¨ï:
* ƒ®àïç ï ª« ¢¨è  ¬®¦¥â áà ¡ â뢠âì «¨¡® ¯à¨ ­ ¦ â¨¨,
«¨¡® ¯à¨ ®â¯ã᪠­¨¨. ‘ª ­ª®¤ ®â¯ã᪠­¨ï ª« ¢¨è¨ ­  128 ¡®«ìè¥,
祬 ᪠­ª®¤ ­ ¦ â¨ï (â.¥. ãáâ ­®¢«¥­ áâ à訩 ¡¨â).
* <20>¥áª®«ìª® ¯à¨«®¦¥­¨© ¬®£ãâ ãáâ ­®¢¨âì ®¤­ã ¨ âã ¦¥ ª®¬¡¨­ æ¨î;
® ­ ¦ â¨¨ â ª®© ª®¬¡¨­ æ¨¨ ¡ã¤ãâ ¨§¢¥é âìáï ¢á¥ â ª¨¥ ¯à¨«®¦¥­¨ï.
------ <20>®¤äã­ªæ¨ï 5 - 㤠«¨âì ãáâ ­®¢«¥­­ãî "£®àïçãî ª« ¢¨èã". -------
<EFBFBD> à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* cl = ᪠­ª®¤ ª« ¢¨è¨ ¨ edx = 0xXYZ â ª¨¥ ¦¥, ª ª ¨ ¢ ¯®¤ä㭪樨 4
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥â â ª®© £®àï祩 ª« ¢¨è¨
‡ ¬¥ç ­¨ï:
* <20>ਠ§ ¢¥à襭¨¨ ¯à®æ¥áá /¯®â®ª  㤠«ïîâáï ¢á¥ ãáâ ­®¢«¥­­ë¥ ¨¬
£®àï稥 ª« ¢¨è¨.
* ‚맮¢ ä㭪樨 ­¥ ¢«¨ï¥â ­  ¤à㣨¥ ¯à¨«®¦¥­¨ï.
…᫨ ¤à㣮¥ ¯à¨«®¦¥­¨¥ ®¯à¥¤¥«¨«® íâã ¦¥ ª®¬¡¨­ æ¨î,
®­® ¯®-¯à¥¦­¥¬ã ¡ã¤¥â ¯®«ãç âì 㢥¤®¬«¥­¨ï.
======================================================================
============ ”ã­ªæ¨ï 67 - ¨§¬¥­¨âì ¯®«®¦¥­¨¥/à §¬¥àë ®ª­ . ===========
======================================================================
@ -4274,8 +4331,8 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
Š®¤ë ᮡë⨩:
* 1 = á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥ (á¡à á뢠¥âáï ¯à¨ ¢ë§®¢¥ ä㭪樨 0)
* 2 = ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãॠ(¯®áâ㯠¥â, ⮫쪮 ª®£¤  ®ª­®
 ªâ¨¢­®; á¡à á뢠¥âáï, ª®£¤  ¢á¥ ª« ¢¨è¨ ¨§ ¡ãä¥à 
áç¨â ­ë ä㭪樥© 2)
 ªâ¨¢­®) ¨«¨ ­ ¦ â  "£®àïç ï ª« ¢¨è ";
á¡à á뢠¥âáï, ª®£¤  ¢á¥ ª« ¢¨è¨ ¨§ ¡ãä¥à  áç¨â ­ë ä㭪樥© 2
* 3 = ­ ¦ â  ª­®¯ª , ®¯à¥¤¥«ñ­­ ï à ­¥¥ ä㭪樥© 8 (¨«¨ ª­®¯ª 
§ ªàëâ¨ï, ᮧ¤ ­­ ï ­¥ï¢­® ä㭪樥© 0; ª­®¯ª  ¬¨­¨¬¨§ æ¨¨
®¡à ¡ â뢠¥âáï á¨á⥬®© ¨ ® ­¥© á®®¡é¥­¨ï ­¥ ¯à¨å®¤¨â;

View File

@ -69,12 +69,21 @@ get_event_for_app:
movzx edx,word [0xC000+ecx*2]
mov eax, [0x3004]
cmp eax,edx
jne no_eventoccur2
jne no_eventoccur2x
cmp [0xf400],byte 0
je no_eventoccur2
je no_eventoccur2x
eventoccur2:
popad
mov eax,2
ret
no_eventoccur2x:
mov eax, hotkey_buffer
@@:
cmp [eax], ecx
jz eventoccur2
add eax, 8
cmp eax, hotkey_buffer+120*8
jb @b
no_eventoccur2:
;mov edi,[0x3010] ; BUTTON IN BUFFER

View File

@ -26,8 +26,64 @@ uglobal
ctrl_alt_del db 0
kb_lights db 0
align 4
hotkey_scancodes rd 256 ; we have 256 scancodes
hotkey_list rd 256*4 ; max 256 defined hotkeys
hotkey_buffer rd 120*2 ; buffer for 120 hotkeys
endg
iglobal
hotkey_tests dd hotkey_test0
dd hotkey_test1
dd hotkey_test2
dd hotkey_test3
dd hotkey_test4
hotkey_tests_num = 5
endg
hotkey_test0:
test al, al
setz al
ret
hotkey_test1:
test al, al
setnp al
ret
hotkey_test2:
cmp al, 3
setz al
ret
hotkey_test3:
cmp al, 1
setz al
ret
hotkey_test4:
cmp al, 2
setz al
ret
hotkey_do_test:
push eax
mov edx, [kb_state]
shr edx, cl
add cl, cl
mov eax, [eax+4]
shr eax, cl
and eax, 15
cmp al, hotkey_tests_num
jae .fail
xchg eax, edx
and al, 3
call [hotkey_tests + edx*4]
cmp al, 1
pop eax
ret
.fail:
stc
pop eax
ret
align 4
irq1:
save_ring3_context
@ -44,52 +100,55 @@ irq1:
in al,0x60
mov [keyboard_data],al
; ch = scancode
; cl = ext_code
; bh = 0 - normal key
; bh = 1 - modifier (Shift/Ctrl/Alt)
; bh = 2 - extended code
mov ch,al
cmp al,0xE0
je @f
cmp al,0xE1
jne .normal_code
@@: mov [ext_code],al
jmp .no_key.end
@@:
mov bh, 2
mov [ext_code], al
jmp .writekey
.normal_code:
mov cl,[ext_code]
mov [ext_code],0
mov cl, 0
xchg cl, [ext_code]
and al,0x7F
mov bh, 1
@@: cmp al,0x2A
jne @f
cmp cl,0xE0
je .no_key.end
je .writekey
mov eax,VKEY_LSHIFT
jmp .no_key
jmp .modifier
@@: cmp al,0x36
jne @f
cmp cl,0xE0
je .no_key.end
je .writekey
mov eax,VKEY_RSHIFT
jmp .no_key
jmp .modifier
@@: cmp al,0x38
jne @f
cmp cl,0xE0
je .alt.r
mov eax, VKEY_LALT
jmp .no_key
.alt.r:
mov eax,VKEY_RALT
jmp .no_key
test cl, cl
jz .modifier
mov al, VKEY_RALT
jmp .modifier
@@: cmp al,0x1D
jne @f
cmp cl,0
jne .ctrl.r
mov eax, VKEY_LCONTROL
jmp .no_key
.ctrl.r:
cmp cl,0xE1
jne .ctrl.r.2
test cl, cl
jz .modifier
mov al, VKEY_RCONTROL
cmp cl, 0xE0
jz .modifier
mov [ext_code], cl
jmp .no_key.end
.ctrl.r.2:
mov eax,VKEY_RCONTROL
jmp .no_key
jmp .writekey
@@: cmp al,0x3A
jne @f
mov bl,4
@ -97,8 +156,8 @@ irq1:
jmp .no_key.xor
@@: cmp al,0x45
jne @f
cmp cl,0
jne .no_key.end
test cl, cl
jnz .writekey
mov bl,2
mov eax,VKEY_NUMLOCK
jmp .no_key.xor
@ -108,8 +167,8 @@ irq1:
mov eax,VKEY_SCRLOCK
jmp .no_key.xor
@@:
test ch,0x80
jnz .no_key.end
test ch,ch
js .writekey
movzx eax,ch ; plain key
mov bl,[keymap+eax]
mov edx,[kb_state]
@ -117,10 +176,9 @@ irq1:
jz .noctrlaltdel
test dl,VKEY_ALT
jz .noctrlaltdel
cmp bl,134+48
cmp ch,53h
jne .noctrlaltdel
mov [ctrl_alt_del],1
jmp .no_key.end
.noctrlaltdel:
test dl,VKEY_CONTROL ; ctrl on ?
jz @f
@ -164,46 +222,89 @@ irq1:
mov [0x2E0000+4096*12+0x10],edx
mov bl,0
@@:
cmp [keyboard_mode],0 ; return from keymap
jne .no_key.end
mov [keyboard_mode_sys],0
cmp bl,0
je .no_key.end
movzx eax,byte[0xF400]
cmp al,120
jae .no_key.end
inc al
mov [0xF400],al
mov [0xF400+eax],bl
jmp .no_key.end
.no_key:
test ch,0x80
jz .no_key.down
mov bh, 0
jmp .writekey
.modifier:
test ch, ch
js .modifier.up
or [kb_state], eax
jmp .writekey
.modifier.up:
not eax
and [kb_state], eax
jmp .no_key.end
jmp .writekey
.no_key.xor:
test ch,0x80
jnz .no_key.end
mov bh, 0
test ch, ch
js .writekey
xor [kb_state], eax
xor [kb_lights], bl
call set_lights
jmp .no_key.end
.no_key.down:
or [kb_state],eax
.no_key.end:
cmp [keyboard_mode],1 ; return scancode
jne .no_scancode
mov [keyboard_mode_sys],1
.writekey:
; test for system hotkeys
movzx eax, ch
cmp bh, 1
ja .nohotkey
jb @f
xor eax, eax
@@:
mov eax, [hotkey_scancodes + eax*4]
.hotkey_loop:
test eax, eax
jz .nohotkey
mov cl, 0
call hotkey_do_test
jc .hotkey_cont
mov cl, 2
call hotkey_do_test
jc .hotkey_cont
mov cl, 4
call hotkey_do_test
jnc .hotkey_found
.hotkey_cont:
mov eax, [eax]
jmp .hotkey_loop
.hotkey_found:
mov eax, [eax+8]
; put key in buffer for process in slot eax
mov edi, hotkey_buffer
@@:
cmp dword [edi], 0
jz .found_free
add edi, 8
cmp edi, hotkey_buffer+120*8
jb @b
; no free space - replace first entry
mov edi, hotkey_buffer
.found_free:
mov [edi], eax
movzx eax, ch
cmp bh, 1
jnz @f
xor eax, eax
@@:
mov [edi+4], ax
mov eax, [kb_state]
mov [edi+6], ax
jmp .exit.irq1
.nohotkey:
cmp [keyboard_mode],0 ; return from keymap
jne .scancode
test bh, bh
jnz .exit.irq1
test bl, bl
jz .exit.irq1
jmp .dowrite
.scancode:
mov bl, ch
.dowrite:
movzx eax,byte[0xF400]
cmp al,120
jae .no_scancode
inc al
jae .exit.irq1
inc eax
mov [0xF400],al
mov [0xF400+eax],ch
.no_scancode:
mov [0xF400+eax],bl
.exit.irq1:
mov [check_idle_semaphore],5

View File

@ -775,7 +775,7 @@ finit ;reset the registers, contents which are still equal RM
mov al, 0xF3 ; set repeat rate & delay
call kb_write
call kb_read
mov al, 00100010b ; 24 500 ;00100100b ; 20 500
mov al, 0 ; 30 250 ;00100010b ; 24 500 ;00100100b ; 20 500
call kb_write
call kb_read
;// mike.dld [
@ -826,7 +826,6 @@ osloop:
call [draw_pointer]
call checkbuttons
call main_loop_sys_getkey
call checkwindows
; call check_window_move_request
call checkmisc
@ -2271,11 +2270,8 @@ sysfn_getdiskinfo: ; 18.11 = get disk info table
rep movsd
ret
sysfn_lastkey: ; 18.12 = get all key pressed with ALT
mov eax,[last_key_press]
mov al,[keyboard_mode_sys]
mov [esp+36],eax
mov [last_key_press],0
sysfn_lastkey: ; 18.12 = return 0 (backward compatibility)
and dword [esp+36], 0
ret
sysfn_getversion: ; 18.13 = get kernel ID and version
@ -2324,8 +2320,6 @@ screen_workarea RECT
;// mike.dld, 2006-29-01 ]
window_minimize db 0
sound_flag db 0
last_key_press dd 0
keyboard_mode_sys db 0
endg
iglobal
@ -2340,15 +2334,6 @@ UID_NONE=0
UID_MENUETOS=1 ;official
UID_KOLIBRI=2 ;russian
main_loop_sys_getkey:
cmp [0xf400],byte 0
je .finish
movzx eax,byte [0xf401]
shl eax,8
mov [last_key_press],eax
.finish:
ret
sys_cachetodiskette:
; pushad
; cmp eax,1
@ -2516,6 +2501,7 @@ align 4
sys_getkey:
mov [esp+36],dword 1
; test main buffer
mov ebx, [0x3000] ; TOP OF WINDOW STACK
movzx ecx,word [0xC000 + ebx * 2]
mov edx,[0x3004]
@ -2538,27 +2524,27 @@ sys_getkey:
mov ebx, 0xF401
call memmove
pop eax
mov [last_key_press],eax
mov eax,[kb_state]
and al,110000b
cmp al,100000b
je .yes_win_key
cmp al,10000b
je .yes_win_key
mov eax,[last_key_press]
jmp .no_win_key
; cmp ah,232
; je .yes_win_key
; cmp ah,233
; jne .no_win_key
.yes_win_key:
mov eax,1
.no_win_key:
.ret_eax:
mov [esp+36],eax
.finish:
ret
.finish:
; test hotkeys buffer
mov ecx, hotkey_buffer
@@:
cmp [ecx], ebx
jz .found
add ecx, 8
cmp ecx, hotkey_buffer+120*8
jb @b
ret
.found:
mov ax, [ecx+6]
shl eax, 16
mov ah, [ecx+4]
mov al, 2
and dword [ecx+4], 0
and dword [ecx], 0
jmp .ret_eax
align 4
@ -4395,26 +4381,23 @@ sys_trace:
sys_process_def:
mov edi, [0x3000]
cmp eax,1 ; set keyboard mode
dec eax ; 1 = set keyboard mode
jne no_set_keyboard_setup
mov edi,[0x3000]
shl edi,8
add edi,0x80000+0xB4
mov [edi],bl
mov [edi+0x800B4],bl
ret
no_set_keyboard_setup:
cmp eax,2 ; get keyboard mode
dec eax ; 2 = get keyboard mode
jne no_get_keyboard_setup
mov edi,[0x3000]
shl edi,8
add edi,0x80000+0xB4
movzx eax, byte [edi]
movzx eax, byte [0x800B4+edi]
mov [esp+36],eax
@ -4422,7 +4405,7 @@ sys_process_def:
no_get_keyboard_setup:
cmp eax,3 ; get keyboard ctrl, alt, shift
dec eax ; 3 = get keyboard ctrl, alt, shift
jne no_get_keyboard_cas
; xor eax,eax
@ -4444,7 +4427,72 @@ sys_process_def:
no_get_keyboard_cas:
dec eax
jnz no_add_keyboard_hotkey
mov eax, hotkey_list
@@:
cmp dword [eax+8], 0
jz .found_free
add eax, 16
cmp eax, hotkey_list+16*256
jb @b
mov dword [esp+36], 1
ret
.found_free:
mov [eax+8], edi
mov [eax+4], ecx
movzx ebx, bl
lea ebx, [hotkey_scancodes+ebx*4]
mov ecx, [ebx]
mov [eax], ecx
mov [ebx], eax
mov [eax+12], ebx
jecxz @f
mov [ecx+12], eax
@@:
and dword [esp+36], 0
ret
no_add_keyboard_hotkey:
dec eax
jnz no_del_keyboard_hotkey
movzx ebx, bl
lea ebx, [hotkey_scancodes+ebx*4]
mov eax, [ebx]
.scan:
test eax, eax
jz .notfound
cmp [eax+8], edi
jnz .next
cmp [eax+4], ecx
jz .found
.next:
mov eax, [eax]
jmp .scan
.notfound:
mov dword [esp+36], 1
ret
.found:
mov ecx, [eax]
jecxz @f
mov edx, [eax+12]
mov [ecx+12], edx
@@:
mov ecx, [eax+12]
mov edx, [eax]
mov [ecx], edx
xor edx, edx
mov [eax+4], edx
mov [eax+8], edx
mov [eax+12], edx
mov [eax], edx
mov [esp+36], edx
ret
no_del_keyboard_hotkey:
ret