Eolite 3.0 beta 4: use scan codes (Part 2)

git-svn-id: svn://kolibrios.org@5702 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2015-08-09 21:59:25 +00:00
parent 1ef40dabc9
commit bfaa4505b4
7 changed files with 89 additions and 48 deletions

View File

@ -339,19 +339,19 @@ void main()
if (Form.status_window>2) break; if (Form.status_window>2) break;
if (del_active) if (del_active)
{ {
if (key == ASCII_KEY_ENTER) Del_File(true); if (key2 == SCAN_CODE_ENTER) Del_File(true);
if (key == ASCII_KEY_ESC) Del_File(false); if (key2 == SCAN_CODE_ESC) Del_File(false);
break; break;
} }
if (new_element_active) if (new_element_active)
{ {
if (key == ASCII_KEY_ESC) NewElement(0); if (key2 == SCAN_CODE_ESC) NewElement(0);
if (key == ASCII_KEY_ENTER) NewElement(1); if (key2 == SCAN_CODE_ENTER) NewElement(1);
EAX=key<<8; EAX=key<<8;
edit_box_key stdcall (#new_file_ed); edit_box_key stdcall (#new_file_ed);
break; break;
} }
if (files.ProcessKey(key)) if (files.ProcessKey(key2))
{ {
List_ReDraw(); List_ReDraw();
break; break;
@ -361,6 +361,15 @@ void main()
{ {
switch(key2) switch(key2)
{ {
case 059...068:
key2 -= 59;
if (key2<disc_num)
{
DrawRectangle(17,key2*16+74,159,16, 0); //display click
pause(7);
ClickOnDisk(key2);
}
break;
case 45: //Ctrl+X case 45: //Ctrl+X
Copy(#file_path, CUT); Copy(#file_path, CUT);
break; break;
@ -379,6 +388,10 @@ void main()
if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD); if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram("/sys/File Managers/Eolite", #path); RunProgram("/sys/File Managers/Eolite", #path);
break; break;
case 028: //Ctrl+Enter
if (!itdir) ShowOpenWithDialog();
else Open(1);
break;
case 030: //Ctrl+A - select all files case 030: //Ctrl+A - select all files
for (i=0; i<files.count; i++) for (i=0; i<files.count; i++)
{ {
@ -402,41 +415,28 @@ void main()
break; break;
} }
switch (key) switch (key2)
{ {
case 096: case 041:
two_panels ^= 1; two_panels ^= 1;
draw_window(); draw_window();
break; break;
case 209...217: case SCAN_CODE_BS:
key -= 210;
if (key<disc_num)
{
DrawRectangle(17,key*16+74,159,16, 0); //display click
pause(7);
ClickOnDisk(key);
}
break;
case ASCII_KEY_BS:
//GoBack(); //GoBack();
Dir_Up(); Dir_Up();
break; break;
case ASCII_KEY_ENTER: case SCAN_CODE_ENTER:
Open(0); Open(0);
break; break;
case 074: //menu case 093: //menu
menu_call_mouse=0; menu_call_mouse=0;
menu_stak = malloc(4096); menu_stak = malloc(4096);
CreateThread(#FileMenu,menu_stak+4092); CreateThread(#FileMenu,menu_stak+4092);
break; break;
case 173: //Ctrl+Enter case SCAN_CODE_DEL:
if (!itdir) ShowOpenWithDialog();
else Open(1);
break;
case ASCII_KEY_DEL:
Del_Form(); Del_Form();
break; break;
case ASCII_KEY_INS: case SCAN_CODE_INS:
selected_offset = file_mas[files.current]*304 + buf+32 + 7; selected_offset = file_mas[files.current]*304 + buf+32 + 7;
if (files.current==0) && (!strncmp(selected_offset+33, "..", 2)) goto _INSERT_END; //do not selec ".." directory if (files.current==0) && (!strncmp(selected_offset+33, "..", 2)) goto _INSERT_END; //do not selec ".." directory
if (ESBYTE[selected_offset]) if (ESBYTE[selected_offset])
@ -452,8 +452,8 @@ void main()
_INSERT_END: _INSERT_END:
if (files.KeyDown()) List_ReDraw(); if (files.KeyDown()) List_ReDraw();
break; break;
case 049...059: //F1-F10 case 059...068: //F1-F10
FnProcess(key-49); FnProcess(key2-58);
break; break;
default: default:
for (i=files.current+1; i<files.count; i++) for (i=files.current+1; i<files.count; i++)

View File

@ -50,7 +50,7 @@ int cur_action_buf;
void FileMenu() void FileMenu()
{ {
word key; word key,key2;
proc_info MenuForm; proc_info MenuForm;
int index; int index;
@ -78,10 +78,13 @@ void FileMenu()
break; break;
case evKey: case evKey:
key = GetKey(); GetFullKey();
if (key==27){cmd_free=1;ExitProcess();} key = AH;
else if (key == 13) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); } $shr eax,16
if (menu.ProcessKey(key)) MenuListRedraw(); key2 = AL;
if (key2==SCAN_CODE_ESC){cmd_free=1;ExitProcess();}
else if (key2 == SCAN_CODE_ENTER) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); }
if (menu.ProcessKey(key2)) MenuListRedraw();
break; break;
case evReDraw: _MENU_DRAW: case evReDraw: _MENU_DRAW:

View File

@ -214,7 +214,7 @@ void GetSizeMoreFiles(dword way)
void properties_dialog() void properties_dialog()
{ {
byte id; byte id;
byte key; byte key,key2;
dword file_name_off; dword file_name_off;
dword selected_offset2; dword selected_offset2;
@ -285,18 +285,35 @@ void properties_dialog()
break; break;
case evKey: case evKey:
key = GetKey(); GetFullKey();
key = AH;
$shr eax,16
key2 = AL;
if (quest_active) if (quest_active)
{ {
IF (key==013) SetProperties(2); IF (key2==SCAN_CODE_ENTER) SetProperties(2);
IF (key==027) SetProperties(1); IF (key2==SCAN_CODE_ESC) SetProperties(1);
break; break;
} }
if (key==27) if (key2==SCAN_CODE_ESC)
{ {
cmd_free=3; cmd_free=3;
ExitProcess(); ExitProcess();
} }
if (key2==SCAN_CODE_ENTER)
{
if (selected_count) || (itdir)
{
quest_active = 1;
Quest();
}
else
{
SetProperties(0);
}
break;
}
EAX=key<<8; EAX=key<<8;
edit_box_key stdcall(#file_name_ed); edit_box_key stdcall(#file_name_ed);
edit_box_key stdcall(#path_to_file_ed); edit_box_key stdcall(#path_to_file_ed);

View File

@ -32,7 +32,7 @@ char confir_section = "Config";
void settings_dialog() void settings_dialog()
{ {
byte id; byte id;
unsigned int key; unsigned int key, key2;
proc_info settings_form; proc_info settings_form;
dword save_show_dev_name,save_real_files_names_case, save_info_after_copy, save_use_big_fonts, save_files_h, save_DBLTime; dword save_show_dev_name,save_real_files_names_case, save_info_after_copy, save_use_big_fonts, save_files_h, save_DBLTime;
@ -96,8 +96,11 @@ void settings_dialog()
break; break;
case evKey: case evKey:
key = GetKey(); GetFullKey();
if (key==27) key = AH;
$shr eax,16
key2 = AL;
if (key2==SCAN_CODE_ESC)
{ {
active_settings = 0; active_settings = 0;
action_buf = 300; action_buf = 300;

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.0 beta 3" #define TITLE "Eolite File Manager v3.0 beta 4"
#define ABOUT_TITLE "Eolite 3.0 beta 3" #define ABOUT_TITLE "Eolite 3.0 beta 4"
#ifdef LANG_RUS #ifdef LANG_RUS
?define T_FILE "” ©«" ?define T_FILE "” ©«"

View File

@ -66,6 +66,24 @@ char program_path[4096];
#define ASCII_KEY_PGDN 183 #define ASCII_KEY_PGDN 183
#define ASCII_KEY_PGUP 184 #define ASCII_KEY_PGUP 184
//SCAN CODE KEYS
#define SCAN_CODE_BS 014
#define SCAN_CODE_TAB 015
#define SCAN_CODE_ENTER 028
#define SCAN_CODE_ESC 001
#define SCAN_CODE_DEL 083
#define SCAN_CODE_INS 082
#define SCAN_CODE_SPACE 057
#define SCAN_CODE_LEFT 075
#define SCAN_CODE_RIGHT 077
#define SCAN_CODE_DOWN 080
#define SCAN_CODE_UP 072
#define SCAN_CODE_HOME 071
#define SCAN_CODE_END 079
#define SCAN_CODE_PGDN 081
#define SCAN_CODE_PGUP 073
//allow event mask //allow event mask
#define EVENT_MASK_REDRAW 000000001b #define EVENT_MASK_REDRAW 000000001b
#define EVENT_MASK_KEYBOARD 000000010b #define EVENT_MASK_KEYBOARD 000000010b

View File

@ -123,12 +123,12 @@ int llist::ProcessKey(dword key)
{ {
switch(key) switch(key)
{ {
case ASCII_KEY_DOWN: return KeyDown(); case SCAN_CODE_DOWN: return KeyDown();
case ASCII_KEY_UP: return KeyUp(); case SCAN_CODE_UP: return KeyUp();
case ASCII_KEY_HOME: return KeyHome(); case SCAN_CODE_HOME: return KeyHome();
case ASCII_KEY_END: return KeyEnd(); case SCAN_CODE_END: return KeyEnd();
case ASCII_KEY_PGUP: return KeyPgUp(); case SCAN_CODE_PGUP: return KeyPgUp();
case ASCII_KEY_PGDN: return KeyPgDown(); case SCAN_CODE_PGDN: return KeyPgDown();
} }
return 0; return 0;
} }