use scancode in appearance, pixie, Calypte

git-svn-id: svn://kolibrios.org@5705 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2015-08-10 07:55:50 +00:00
parent eca8c966f9
commit 070569f1e1
3 changed files with 62 additions and 35 deletions

View File

@ -62,7 +62,7 @@ struct menu_text_struct
#define WIN_W 600
#define WIN_H 400
#define TITLE "Calypte v0.12"
#define TITLE "Calypte v0.13"
char win_title[4096] = TITLE;
proc_info Form;
@ -111,7 +111,9 @@ menu_data menudata1 = {0, 40, 2, 15, 2, #menu_text_area1.menu, #menu_text_area1.
void main()
{
int id, key;
int id;
word key_ascii, key_scancode;
dword status_key;
strcpy(#filter2.ext1, "TXT");
//strcpy(#filter2.ext2, "ASM");
@ -153,6 +155,7 @@ void main()
break;
case 2:
read = 0;
tview.current = 0;
strcpy(#win_title, TITLE);
FreeBuf();
draw_window();
@ -182,28 +185,40 @@ void main()
case evKey:
if (Form.status_window>2) break;
key = GetKey();
switch (key)
GetFullKey();
key_ascii = AH;
$shr eax,16
key_scancode = AL;
status_key = GetStatusKey();
if (tview.ProcessKey(key_scancode)) DrawText();
if (TestBit(status_key, 2))
{
case 015: //Ctrl+O
OpenDialog_start stdcall (#o_dialog);
OpenFile(#openfile_path);
Prepare();
draw_window();
break;
case ASCII_KEY_HOME:
case ASCII_KEY_END:
case ASCII_KEY_UP:
case ASCII_KEY_DOWN:
if (tview.ProcessKey(key)) DrawText();
break;
case ASCII_KEY_PGUP:
switch(key_scancode)
{
case 024: //Ctrl+O
OpenDialog_start stdcall (#o_dialog);
OpenFile(#openfile_path);
Prepare();
draw_window();
break;
}
break;
}
switch (key_scancode)
{
/*case SCAN_CODE_HOME:
case SCAN_CODE_END:
case SCAN_CODE_UP:
case SCAN_CODE_DOWN:
if (tview.ProcessKey(key_scancode)) DrawText();
break;*/
case SCAN_CODE_PGUP:
if (!tview.current) break;
if (tview.current<tview.visible) tview.current = 0;
else tview.current = tview.current-tview.visible;
DrawText();
break;
case ASCII_KEY_PGDN:
case SCAN_CODE_PGDN:
if (tview.current+tview.visible>tview.count) break;
tview.current = tview.current+tview.visible;
DrawText();

View File

@ -145,7 +145,9 @@ OpenFile()
void main()
{
int id, key, mouse_clicked;
int id, mouse_clicked;
word key_ascii, key_scancode;
dword status_key;
SetEventMask(0x27);
load_dll(boxlib, #box_lib_init,0);
@ -193,12 +195,16 @@ void main()
break;
case evKey:
key = GetKey();
if (list[SKINS].active) && (list[SKINS].ProcessKey(key)) Apply();
if (list[WALLPAPERS].active) && (list[WALLPAPERS].ProcessKey(key)) Apply();
IF (key==013) OpenFile();
if (key==9) if (list[SKINS].active) TabClick(WALLPAPERS); else TabClick(SKINS);
IF (key==182) //Del
GetFullKey();
key_ascii = AH;
$shr eax,16
key_scancode = AL;
status_key = GetStatusKey();
if (list[SKINS].active) && (list[SKINS].ProcessKey(key_scancode)) Apply();
if (list[WALLPAPERS].active) && (list[WALLPAPERS].ProcessKey(key_scancode)) Apply();
IF (key_scancode==SCAN_CODE_ENTER) OpenFile();
if (key_scancode==SCAN_CODE_TAB) if (list[SKINS].active) TabClick(WALLPAPERS); else TabClick(SKINS);
IF (key_scancode==SCAN_CODE_TAB) //Del
{
DeleteFile(#cur_file_path);
Open_Dir();

View File

@ -73,7 +73,9 @@ char work_folder[4096],
void main()
{
int id, key;
int id;
word key_ascii, key_scancode;
byte mouse_clicked;
dword tmp_x,tmp_y;
dword z1,z2;
@ -229,19 +231,23 @@ void main()
break;
case evKey:
key = GetKey();
if (key==50) SetColorThemeLight();
if (key==51) SetColorThemeDark();
if (key==ASCII_KEY_LEFT) RunProgram("@VOLUME", "-");
if (key==ASCII_KEY_RIGHT) RunProgram("@VOLUME", "+");
if (key=='m') RunProgram("@VOLUME", "m");
if (key==ASCII_KEY_ENTER) StartPlayingMp3();
if (key=='p') || (key==ASCII_KEY_SPACE)
GetFullKey();
key_ascii = AH;
$shr eax,16
key_scancode = AL;
if (key_scancode==003) SetColorThemeLight();
if (key_scancode==004) SetColorThemeDark();
if (key_scancode==SCAN_CODE_LEFT) RunProgram("@VOLUME", "-");
if (key_scancode==SCAN_CODE_RIGHT) RunProgram("@VOLUME", "+");
if (key_scancode==050) RunProgram("@VOLUME", "m");
if (key_scancode==SCAN_CODE_ENTER) StartPlayingMp3();
if (key_scancode==025) || (key_scancode==SCAN_CODE_SPACE)
{
if (playback_mode == PLAYBACK_MODE_PLAYING) StopPlayingMp3();
else StartPlayingMp3();
}
if (list.ProcessKey(key)) DrawPlayList();
if (list.ProcessKey(key_scancode)) DrawPlayList();
break;
case evReDraw: