forked from KolibriOS/kolibrios
use scancode in appearance, pixie, Calypte
git-svn-id: svn://kolibrios.org@5705 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
eca8c966f9
commit
070569f1e1
@ -62,7 +62,7 @@ struct menu_text_struct
|
|||||||
#define WIN_W 600
|
#define WIN_W 600
|
||||||
#define WIN_H 400
|
#define WIN_H 400
|
||||||
|
|
||||||
#define TITLE "Calypte v0.12"
|
#define TITLE "Calypte v0.13"
|
||||||
char win_title[4096] = TITLE;
|
char win_title[4096] = TITLE;
|
||||||
proc_info Form;
|
proc_info Form;
|
||||||
|
|
||||||
@ -111,7 +111,9 @@ menu_data menudata1 = {0, 40, 2, 15, 2, #menu_text_area1.menu, #menu_text_area1.
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int id, key;
|
int id;
|
||||||
|
word key_ascii, key_scancode;
|
||||||
|
dword status_key;
|
||||||
|
|
||||||
strcpy(#filter2.ext1, "TXT");
|
strcpy(#filter2.ext1, "TXT");
|
||||||
//strcpy(#filter2.ext2, "ASM");
|
//strcpy(#filter2.ext2, "ASM");
|
||||||
@ -153,6 +155,7 @@ void main()
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
read = 0;
|
read = 0;
|
||||||
|
tview.current = 0;
|
||||||
strcpy(#win_title, TITLE);
|
strcpy(#win_title, TITLE);
|
||||||
FreeBuf();
|
FreeBuf();
|
||||||
draw_window();
|
draw_window();
|
||||||
@ -182,28 +185,40 @@ void main()
|
|||||||
|
|
||||||
case evKey:
|
case evKey:
|
||||||
if (Form.status_window>2) break;
|
if (Form.status_window>2) break;
|
||||||
key = GetKey();
|
GetFullKey();
|
||||||
switch (key)
|
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
|
switch(key_scancode)
|
||||||
|
{
|
||||||
|
case 024: //Ctrl+O
|
||||||
OpenDialog_start stdcall (#o_dialog);
|
OpenDialog_start stdcall (#o_dialog);
|
||||||
OpenFile(#openfile_path);
|
OpenFile(#openfile_path);
|
||||||
Prepare();
|
Prepare();
|
||||||
draw_window();
|
draw_window();
|
||||||
break;
|
break;
|
||||||
case ASCII_KEY_HOME:
|
}
|
||||||
case ASCII_KEY_END:
|
|
||||||
case ASCII_KEY_UP:
|
|
||||||
case ASCII_KEY_DOWN:
|
|
||||||
if (tview.ProcessKey(key)) DrawText();
|
|
||||||
break;
|
break;
|
||||||
case ASCII_KEY_PGUP:
|
}
|
||||||
|
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) break;
|
||||||
if (tview.current<tview.visible) tview.current = 0;
|
if (tview.current<tview.visible) tview.current = 0;
|
||||||
else tview.current = tview.current-tview.visible;
|
else tview.current = tview.current-tview.visible;
|
||||||
DrawText();
|
DrawText();
|
||||||
break;
|
break;
|
||||||
case ASCII_KEY_PGDN:
|
case SCAN_CODE_PGDN:
|
||||||
if (tview.current+tview.visible>tview.count) break;
|
if (tview.current+tview.visible>tview.count) break;
|
||||||
tview.current = tview.current+tview.visible;
|
tview.current = tview.current+tview.visible;
|
||||||
DrawText();
|
DrawText();
|
||||||
|
@ -145,7 +145,9 @@ OpenFile()
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int id, key, mouse_clicked;
|
int id, mouse_clicked;
|
||||||
|
word key_ascii, key_scancode;
|
||||||
|
dword status_key;
|
||||||
|
|
||||||
SetEventMask(0x27);
|
SetEventMask(0x27);
|
||||||
load_dll(boxlib, #box_lib_init,0);
|
load_dll(boxlib, #box_lib_init,0);
|
||||||
@ -193,12 +195,16 @@ void main()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case evKey:
|
case evKey:
|
||||||
key = GetKey();
|
GetFullKey();
|
||||||
if (list[SKINS].active) && (list[SKINS].ProcessKey(key)) Apply();
|
key_ascii = AH;
|
||||||
if (list[WALLPAPERS].active) && (list[WALLPAPERS].ProcessKey(key)) Apply();
|
$shr eax,16
|
||||||
IF (key==013) OpenFile();
|
key_scancode = AL;
|
||||||
if (key==9) if (list[SKINS].active) TabClick(WALLPAPERS); else TabClick(SKINS);
|
status_key = GetStatusKey();
|
||||||
IF (key==182) //Del
|
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);
|
DeleteFile(#cur_file_path);
|
||||||
Open_Dir();
|
Open_Dir();
|
||||||
|
@ -73,7 +73,9 @@ char work_folder[4096],
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int id, key;
|
int id;
|
||||||
|
word key_ascii, key_scancode;
|
||||||
|
|
||||||
byte mouse_clicked;
|
byte mouse_clicked;
|
||||||
dword tmp_x,tmp_y;
|
dword tmp_x,tmp_y;
|
||||||
dword z1,z2;
|
dword z1,z2;
|
||||||
@ -229,19 +231,23 @@ void main()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case evKey:
|
case evKey:
|
||||||
key = GetKey();
|
GetFullKey();
|
||||||
if (key==50) SetColorThemeLight();
|
key_ascii = AH;
|
||||||
if (key==51) SetColorThemeDark();
|
$shr eax,16
|
||||||
if (key==ASCII_KEY_LEFT) RunProgram("@VOLUME", "-");
|
key_scancode = AL;
|
||||||
if (key==ASCII_KEY_RIGHT) RunProgram("@VOLUME", "+");
|
|
||||||
if (key=='m') RunProgram("@VOLUME", "m");
|
if (key_scancode==003) SetColorThemeLight();
|
||||||
if (key==ASCII_KEY_ENTER) StartPlayingMp3();
|
if (key_scancode==004) SetColorThemeDark();
|
||||||
if (key=='p') || (key==ASCII_KEY_SPACE)
|
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();
|
if (playback_mode == PLAYBACK_MODE_PLAYING) StopPlayingMp3();
|
||||||
else StartPlayingMp3();
|
else StartPlayingMp3();
|
||||||
}
|
}
|
||||||
if (list.ProcessKey(key)) DrawPlayList();
|
if (list.ProcessKey(key_scancode)) DrawPlayList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case evReDraw:
|
case evReDraw:
|
||||||
|
Loading…
Reference in New Issue
Block a user