% Anyremote configuration file for emulation of some GNOME keyboard shortcuts,
% and some basic launch functions by menu.
%
% Supported for server-mode. Works with all-in-one configuration files.
%
% The choice of icons is supposed to have a mnemonic effect:
% Some cribs help to remember the key settings. See comments below.
%
% Buttons and Icons:
%
% 1: Open the main applicatons menu. (F10)
% * 1: Close menu or other objects. (Esc)
% Icon "plus" means the access to additional features.
% 
% 2: Up.
% * 2: Page up.
%
% 3: Maximise window to fullscreen. (F11)
% * 3: Open window menu, includes minimising and maximising. (Alt-Space)
% Icon "fullscreen" means the switch to fullscreen, 
% and alludes to the menu window containing other window actions.
%
% 4: Left.
% * 4: Home.
%
% 5: Open file. (Ctrl-Q).
% * 5: Locate file. (Ctrl-L)
% Icon "folder" depicts the open or locate action.
%
% 6: Right.
% * 6: End.
%
% 7: Focus on previous object. (Shift-Tab)
% * 7: Switch to previous window. (Alt-Shift-Tab)
% Icon "rewind" indicates backward switching.
%
% 8: Down.
% * 8: Page down.
%
% 9: Focus on next object.
% * 9: Switch to next window.
% Icon "fast forward" indicates forward switching.
%
% *: Modifier for other buttons to reach alternative assignment.
% * *: Help.
% Icon "?" marks help.
%
% 0: Select object. (Space)
% * 0: Return, often same effect achieved by space. (Return)
% Icon "empty rectangle" is associated with space.
%
% #: Quit application. (Ctrl-Q)
% * #: Exit window. (Alt-F4)
%
% Menu:
%
% - Panel: Switch to GNOME panel. (Alt-F1)
% - Execute: Execute application given by name.
% - Text: Send text to remote host, "typewriter".
% - Backspace: Same effect as backspace-key.

GuiAppName=GNOME keyboard shortcuts
GuiAppBinary=true
GuiAppIcon=keyboard.png
GuiAppType=Emulation
GuiAppProtocols=Server
GuiAppDesc=Some useful GNOME keyboard shortcuts for application control.

[Protocol]=Server

(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);
(Connect)=Make(mode,GNOME);

SHORTCUTS=Set(menu,replace,Panel,Execute,Text,Backspace);Macro(ALLIN1MENU)

Panel=Emulate(keydown,Alt_L,key,F1,keyup,Alt_L)
Execute=Set(editfield,Execute,Enter application name,);Make(mode,exec)
Text=Set(editfield,Show text,Enter text,);Make(mode,text)
Backspace=Emulate(key,BackSpace)

[Mode]=GNOME

Cancel=Exit

(EnterMode)=\
	Set(status,keyboard emulation);\
	Set(title,GNOME keyboard shortcuts);\
	Set(skin,default);\
	Set(icons,GNOME,1,plus,2,up,3,fullscreen,4,left,5,folder,6,right,7,rewind,8,down,9,forward,*,question,0,click_icon,#,no);\
	Macro(SHORTCUTS);

Back=Set(text,close);Macro(SHORTCUTS);

1=Emulate(key,F10)
* 1=Emulate(key,Escape)
2=Emulate(key,Up)
* 2=Emulate(key,Page_Up)
3=Emulate(key,F11)
* 3=Emulate(keydown,Alt_L,key,space,keyup,Alt_L)
4=Emulate(key,Left)
* 4=Emulate(key,Home)
5=Emulate(keydown,Control_L,key,o,keyup,Control_L)
* 5=Emulate(keydown,Control_L,key,l,keyup,Control_L)
6=Emulate(key,Right)
* 6=Emulate(key,End)
7=Emulate(keydown,Shift_L,key,Tab,keyup,Shift_L)
* 7=Emulate(keydown,Alt_L,keydown,Shift_L,key,Tab,keyup,Shift_L,keyup,Alt_L)
8=Emulate(key,Down)
* 8=Emulate(key,Page_Down)
9=Emulate(key,Tab)
* 9=Emulate(keydown,Alt_L,key,Tab,keyup,Alt_L)
0=Emulate(key,space)
* 0=Emulate(key,Return)
#=Emulate(keydown,Control_L,key,q,keyup,Control_L)
* #=Emulate(keydown,Alt_L,key,F4,keyup,Alt_L)

* *=Set(text,replace,Help,1 - AppMenu/Esc\n2 - Up/PgUp\n3 - FullScreen/WinMenu\n4 - Left/Home\n5 - Open/Locate\n6 - Right/End\n7 - PrevFocus/PrevWin\n8 - Down/PgDn\n9 - NextFocus/NextWin\n* - Modifier/Help\n0 - Space/Return\n# - Quit/Exit\n\nPanel - focus on panel\nExecute - execute app\nText - text typewriter\nBackspace - backspace)

[ModeEnd]

[Mode]=exec
Ok($$)=Exec($(Param));Make(mode,GNOME)
Back=Make(mode,GNOME)
[ModeEnd]

[Mode]=text
Ok($$)=Exec(xte "str $(Param)");Make(mode,GNOME)
Back=Make(mode,GNOME)
[ModeEnd]

[End]
