Functions 66.6, 66.7 - control input from the keyboard for hotkeys

git-svn-id: svn://kolibrios.org@2709 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2012-06-01 00:58:16 +00:00
parent 896eb433ec
commit dfaeeb56ff
5 changed files with 115 additions and 23 deletions

View File

@ -425,6 +425,17 @@ term9:
add eax, 16
cmp eax, hotkey_list+256*16
jb .loop
; get process PID
mov eax, esi
shl eax, 5
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
; compare current lock input with process PID
cmp eax, [PID_lock_input]
jne @f
xor eax, eax
mov [PID_lock_input], eax
@@:
; remove hotkeys in buffer
mov eax, hotkey_buffer
.loop2:

View File

@ -3468,6 +3468,27 @@ IPC
…᫨ ¤à㣮¥ ¯à¨«®¦¥­¨¥ ®¯à¥¤¥«¨«® íâã ¦¥ ª®¬¡¨­ æ¨î,
®­® ¯®-¯à¥¦­¥¬ã ¡ã¤¥â ¯®«ãç âì 㢥¤®¬«¥­¨ï.
------------- <20>®¤äã­ªæ¨ï 6 - § ¡«®ª¨à®¢ âì ®¡ëç­ë© ¢¢®¤. -------------
<EFBFBD> à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* <20>«®ª¨àã¥âáï ®¡ëç­ë© ¢¢®¤ ¤ ­­ëå á ª« ¢¨ âãàë ¤«ï ãáâ ­®¢«¥­­ëå
"£®àïç¨å" ª« ¢¨è
* „«ï í¬ã«ï樨 ¬ëè¨ ç¥à¥§ ª« ¢¨ âãàã, ¯à¨«®¦¥­¨¥ MOUSEMUL
--------- <20>®¤äã­ªæ¨ï 7 - à §¡«®ª¨à®¢ âì ®¡ëç­ë© ¢¢®¤. ----------------
<EFBFBD> à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* <20> §¡«®ª¨à®¢ ­¨¥ १ã«ìâ â®¢ ä. 66.6
* „«ï í¬ã«ï樨 ¬ëè¨ ç¥à¥§ ª« ¢¨ âãàã, ¯à¨«®¦¥­¨¥ MOUSEMUL
======================================================================
============ ”ã­ªæ¨ï 67 - ¨§¬¥­¨âì ¯®«®¦¥­¨¥/à §¬¥àë ®ª­ . ===========
======================================================================

View File

@ -3448,6 +3448,26 @@ Remarks:
If other application has defined the same combination, it will
still receive notices.
--------------- Subfunction 6 - block the normal input. --------------
Parameters:
* eax = 66 - function number
* ebx = 6 - subfunction number
Returned value:
* function does not return value
Remarks:
* Blocking the normal keyboard input for installed hotkeys
* To emulate a mouse via the keyboard, the application MOUSEMUL
------------ Subfunction 7 - unlock the normal input. ----------------
Parameters:
* eax = 66 - function number
* ebx = 7 - subfunction number
Returned value:
* function does not return value
Remarks:
* Unlocking the results of the f. 66.6
* To emulate a mouse via the keyboard, the application MOUSEMUL
======================================================================
========= Function 67 - change position/sizes of the window. =========
======================================================================

View File

@ -416,9 +416,16 @@ send_scancode:
mov [edi+4], ax
mov eax, [kb_state]
mov [edi+6], ax
cmp [PID_lock_input], dword 0
je .nohotkey
popad
jmp .exit.irq1
;--------------------------------------
.nohotkey:
popad
cmp [keyboard_mode], 0; return from keymap
jne .scancode

View File

@ -4617,17 +4617,17 @@ f66call:
dd sys_process_def.1 ; 1 = set keyboard mode
dd sys_process_def.2 ; 2 = get keyboard mode
dd sys_process_def.3 ; 3 = get keyboard ctrl, alt, shift
dd sys_process_def.4
dd sys_process_def.5
dd sys_process_def.4 ; 4 = set system-wide hotkey
dd sys_process_def.5 ; 5 = delete installed hotkey
dd sys_process_def.6 ; 6 = disable input, work only hotkeys
dd sys_process_def.7 ; 7 = enable input, opposition to f.66.6
endg
;-----------------------------------------------------------------------------
align 4
sys_process_def:
dec ebx
cmp ebx, 5
jae .not_support ;if >=6 then or eax,-1
cmp ebx, 7
jae .not_support ;if >=8 then or eax,-1
mov edi, [CURRENT_TASK]
jmp dword [f66call+ebx*4]
@ -4635,33 +4635,28 @@ sys_process_def:
.not_support:
or eax, -1
ret
;-----------------------------------------------------------------------------
align 4
.1:
shl edi, 8
mov [edi+SLOT_BASE + APPDATA.keyboard_mode], cl
ret
;-----------------------------------------------------------------------------
align 4
.2: ; 2 = get keyboard mode
shl edi, 8
movzx eax, byte [SLOT_BASE+edi + APPDATA.keyboard_mode]
mov [esp+32], eax
ret
; xor eax,eax
; movzx eax,byte [shift]
; movzx ebx,byte [ctrl]
; shl ebx,2
; add eax,ebx
; movzx ebx,byte [alt]
; shl ebx,3
; add eax,ebx
;-----------------------------------------------------------------------------
align 4
.3: ;3 = get keyboard ctrl, alt, shift
;// mike.dld [
mov eax, [kb_state]
;// mike.dld ]
mov [esp+32], eax
ret
;-----------------------------------------------------------------------------
align 4
.4:
mov eax, hotkey_list
@@:
@ -4686,7 +4681,8 @@ sys_process_def:
@@:
and dword [esp+32], 0
ret
;-----------------------------------------------------------------------------
align 4
.5:
movzx ebx, cl
lea ebx, [hotkey_scancodes+ebx*4]
@ -4720,8 +4716,45 @@ sys_process_def:
mov [eax], edx
mov [esp+32], edx
ret
;-----------------------------------------------------------------------------
align 4
.6:
pushfd
cli
mov eax, [PID_lock_input]
test eax, eax
jnz @f
; get current PID
mov eax, [CURRENT_TASK]
shl eax, 5
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
; set current PID for lock input
mov [PID_lock_input], eax
@@:
popfd
ret
;-----------------------------------------------------------------------------
align 4
.7:
mov eax, [PID_lock_input]
test eax, eax
jz @f
; get current PID
mov ebx, [CURRENT_TASK]
shl ebx, 5
mov ebx, [ebx+CURRENT_TASK+TASKDATA.pid]
; compare current lock input with current PID
cmp ebx, eax
jne @f
xor eax, eax
mov [PID_lock_input], eax
@@:
ret
;-----------------------------------------------------------------------------
uglobal
PID_lock_input dd 0x0
endg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 61 sys function. ;;
;; in eax=61,ebx in [1..3] ;;