Eolite 3.01 beta: use scan codes (Part 1)

git-svn-id: svn://kolibrios.org@5697 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2015-08-09 18:23:01 +00:00
parent b3f28579db
commit 0404a36cf4
2 changed files with 62 additions and 41 deletions

View File

@ -103,8 +103,8 @@
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
enum { CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement enum { CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement
#define TITLE "Eolite File Manager v3.0 beta" #define TITLE "Eolite File Manager v3.01 beta"
#define ABOUT_TITLE "Eolite 3.0 beta" #define ABOUT_TITLE "Eolite 3.01 beta"
dword col_padding, col_selec, col_lpanel; dword col_padding, col_selec, col_lpanel;
int toolbar_buttons_x[7]={9,46,85,134,167,203}; int toolbar_buttons_x[7]={9,46,85,134,167,203};
@ -177,7 +177,8 @@ byte cmd_free=0;
void main() void main()
{ {
word key, id; word key,key2, id;
dword status_key;
char can_show, can_select, stats; char can_show, can_select, stats;
dword selected_offset; dword selected_offset;
dword IPC_LEN,IPC_ID; dword IPC_LEN,IPC_ID;
@ -407,7 +408,12 @@ void main()
break; break;
//Key pressed----------------------------------------------------------------------------- //Key pressed-----------------------------------------------------------------------------
case evKey: case evKey:
key = GetKey(); GetFullKey();
key = AH;
$shr eax,16
key2 = AL;
status_key = GetStatusKey();
if (Form.status_window>2) break; if (Form.status_window>2) break;
if (del_active) if (del_active)
{ {
@ -434,6 +440,52 @@ void main()
List_ReDraw(); List_ReDraw();
break; break;
} }
if (TestBit(status_key, 2))
{
switch(key2)
{
case 45: //Ctrl+X
Copy(#file_path, CUT);
break;
case 46: //Ctrl+C
Copy(#file_path, NOCUT);
break;
case 47: //Ctrl+V
Paste();
break;
case 032: //Ctrl+D - set as bg
strncpy(#temp, "\\S__",4);
strcat(#temp, #file_path);
RunProgram("/sys/media/kiv", #temp);
break;
case 049: //Ctrl+N - create new window
if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram("/sys/File Managers/Eolite", #path);
break;
case 030: //Ctrl+A - select all files
for (i=0; i<files.count; i++)
{
selected_offset = file_mas[i]*304 + buf+32 + 7;
if (!i) if (!strncmp(selected_offset+33, "..", 2)) continue; //do not selec ".." directory
ESBYTE[selected_offset] = 1;
selected_count++;
}
List_ReDraw();
break;
case 022: //Ctrl+U - unselect all files
for (i=0; i<files.count; i++)
{
selected_offset = file_mas[i]*304 + buf+32 + 7;
ESBYTE[selected_offset] = 0;
}
selected_count = 0;
List_ReDraw();
break;
}
break;
}
switch (key) switch (key)
{ {
case 209...217: case 209...217:
@ -444,43 +496,6 @@ void main()
//GoBack(); //GoBack();
Dir_Up(); Dir_Up();
break; break;
case 004: //Ctrl+D - set as bg
strncpy(#temp, "\\S__",4);
strcat(#temp, #file_path);
RunProgram("/sys/media/kiv", #temp);
break;
case 014: //Ctrl+N - create new window
if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram("/sys/File Managers/Eolite", #path);
break;
case 024: //Ctrl+X
Copy(#file_path, CUT);
break;
case 003: //Ctrl+C
Copy(#file_path, NOCUT);
break;
case 022: //Ctrl+V
Paste();
break;
case 001: //Ctrl+A - select all files
for (i=0; i<files.count; i++)
{
selected_offset = file_mas[i]*304 + buf+32 + 7;
if (!i) if (!strncmp(selected_offset+33, "..", 2)) continue; //do not selec ".." directory
ESBYTE[selected_offset] = 1;
selected_count++;
}
List_ReDraw();
break;
case 021: //Ctrl+U - unselect all files
for (i=0; i<files.count; i++)
{
selected_offset = file_mas[i]*304 + buf+32 + 7;
ESBYTE[selected_offset] = 0;
}
selected_count = 0;
List_ReDraw();
break;
case ASCII_KEY_ESC: case ASCII_KEY_ESC:
break; break;
case ASCII_KEY_ENTER: case ASCII_KEY_ENTER:

View File

@ -130,6 +130,12 @@ inline fastcall ScancodesGeting(){
$int 0x40 $int 0x40
} }
inline fastcall GetStatusKey(){
$mov eax,66
$mov ebx,3
$int 0x40
}
inline fastcall word GetKey() //+Gluk fix inline fastcall word GetKey() //+Gluk fix
{ {
$push edx $push edx