sysmon: kill process by delete key

@icon: fix old issue with accedental icon click when user moved clicked mouse from active window

git-svn-id: svn://kolibrios.org@7956 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-19 21:39:09 +00:00
parent 895aef63b4
commit 7c4990bd81
2 changed files with 20 additions and 7 deletions

View File

@ -45,6 +45,7 @@ void Processes__Main()
break; break;
case evKey: case evKey:
Sysmon__KeyEvent(); Sysmon__KeyEvent();
if (key_scancode == SCAN_CODE_DEL) EventKillCurrentProcess();
if (select_list.ProcessKey(key_scancode)) SelectList_LineChanged(); if (select_list.ProcessKey(key_scancode)) SelectList_LineChanged();
break; break;
case evButton: case evButton:
@ -54,9 +55,7 @@ void Processes__Main()
SelectList_LineChanged(); SelectList_LineChanged();
} }
if (BTN_ID_KILL_PROCESS == btn) { if (BTN_ID_KILL_PROCESS == btn) {
KillProcess(current_process_id); EventKillCurrentProcess();
pause(10);
SelectList_LineChanged();
} }
if (BTN_ID_SHOW_PROCESS_INFO == btn) { if (BTN_ID_SHOW_PROCESS_INFO == btn) {
io.run("/sys/tinfo", itoa(GetProcessSlot(current_process_id))); io.run("/sys/tinfo", itoa(GetProcessSlot(current_process_id)));
@ -88,6 +87,13 @@ void Processes__Main()
} }
} }
void EventKillCurrentProcess()
{
KillProcess(current_process_id);
pause(10);
SelectList_LineChanged();
}
void Processes__GetProcessList() void Processes__GetProcessList()
{ {
int i, j; int i, j;

View File

@ -196,10 +196,17 @@ MSGMouse:
mov [MouseX],ebx mov [MouseX],ebx
mcall 37,2 mcall 37,3
test al,001b test eax,1b ; bit 0 is set = left button is held
jnz @f
jmp CheckRB
@@:
test eax,100000000b ; bit 8 is set = left button is pressed
jnz @f
jmp CheckRB
@@:
jnz LButtonPress jnz LButtonPress
test al,010b CheckRB:
jnz RButtonPress jnz RButtonPress
jmp messages jmp messages