User Tools

Site Tools


client:keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
client:keys [2018/04/01 07:56] – Add more correct code hints karlclient:keys [2025/04/18 13:09] (current) – external edit 127.0.0.1
Line 5: Line 5:
 This page is about the **keys** file inside the user's HOME directory **.**[[crossfire]] . This page is about the **keys** file inside the user's HOME directory **.**[[crossfire]] .
  
 +
 +===== Creation of the Keys file ==
 When the [[:client]] starts the first time, then there will be no "keys" file, \\ When the [[:client]] starts the first time, then there will be no "keys" file, \\
-and **if** the user never would use the bind and [[:player_commands#unbind]] commands, \\+and **if** the user never would use the [[:player_commands#bind]] and [[:player_commands#unbind]] commands, \\
 then would that file likely never exist there. then would that file likely never exist there.
  
Line 30: Line 32:
 never tried to set this '0' manually to something else - \\  never tried to set this '0' manually to something else - \\ 
 and the **FLAGS** are and the **FLAGS** are
-|#define KEYF_NORMAL     |0x01|// 'N' Used in normal mode //| +== Older == 
-|#define KEYF_FIRE       |0x02|// 'F' Used in fire mode //| +|#define KEYF_NORMAL |0x01^N|// Used in normal mode //| 
-|#define KEYF_RUN        |0x04|// 'R' Used in run mode //| +|#define KEYF_FIRE   |0x02^F|// Used in [[:firekey|fire mode]] //| 
-|#define KEYF_EDIT       |0x08|// 'E' Line editor //| +|#define KEYF_RUN    |0x04^R|// Used in [[:runkey|run mode]] //| 
-|#define KEYF_STANDARD   |0x10|// 'S' For standard/built-in keybinds //| +|#define KEYF_MODIFIERS  |0x07((includes 01,02,04))^A|// Mask for actual keyboard modifiers, not action modifiers //| 
-|#define KEYF_ALT        |0x20|// 'L' For ALT key modifier //| +|#define KEYF_EDIT   |0x08^E|// Line editor //| 
-|#define KEYF_META       |0x40|// 'M' For Meta key modifier //| +|#define KEYF_STANDARD   |0x10^S|// For standard (built inkey definitions //|
-|#define KEYF_MODIFIERS  |0x67((includes 01,02,04,20,40))|// 'A' Mask for actual keyboard modifiers, not action modifiers //|+
  
 +== Newer ==
 +|#define KEYF_NORMAL     |0x01^N|//Used in normal mode //|
 +|#define KEYF_FIRE       |0x02^F|//Used in fire mode //|
 +|#define KEYF_RUN        |0x04^R|//Used in run mode //|
 +|#define KEYF_EDIT       |0x08^E|//Line editor //|
 +|#define KEYF_STANDARD   |0x10^S|//For standard/built-in keybinds //|
 +|#define KEYF_ALT        |0x20^L|//For ALT key modifier //|
 +|#define KEYF_META       |0x40^M|//For Meta key modifier //|
 +|#define KEYF_MODIFIERS  |0x67((includes 01,02,04,20,40))^A|// 'A' Mask for actual keyboard modifiers, not action modifiers //|
 +
 +----
 +
 +==== Special Keybinding Line ==
 +Special key bound lines start with an exclamation mark <hi>**!**</hi> as very first char of the line. \\
 +The special commands are :
 +  * altkey0 ( newer clients )
 +  * altkey1 ( newer clients )
 +  * commandkey - default bound to Quote **'**
 +  * completekey - :?: what does it do :?:
 +  * firekey0
 +  * firekey1
 +  * metakey0 ( newer clients )
 +  * metakey1 ( newer clients )
 +  * nextkey
 +  * prevkey
 +  * runkey0
 +  * runkey1
 +<WRAP lo>( [While [[#parsing of the keys file]]((keys.c:parse_keybind_line() )) , lines beginning with a number sign '#' and starting with a new-line are ignored )</WRAP>
 +
 +----
 +
 +==== Example Keys File == 
 In this example using a GTK-1 client v1.11.0 , \\ In this example using a GTK-1 client v1.11.0 , \\
 the small letter [[#w]]((which is not member of the default keys)) is bound to \\ the small letter [[#w]]((which is not member of the default keys)) is bound to \\
Line 129: Line 162:
 </code> </code>
  
 +----
 +
 +===== Parsing of the Keys file ==
 +
 +When the  client starts, it checks for environmental variables \\
 +CFCLIENT_LIBDIR and CF_DATADIR . \\
 +:!: These variabes are not named "understandable" \\
 +like CF_CLIENT_LIBDIR and CF_CLIENT_DATADIR :!:
 +
 +While the CF_DATADIR is used for theme and glade files, \\
 +the **CFCLIENT_LIBDIR** is only used to look for a file named **def-keys** , \\
 +which is included in the source code, but probably not in pre-packaged \\
 +binary archives of OS distributions; since make install in the source code \\
 +does not automatically install some {prefix}/lib/crossfire-client/def-keys file. \\
 +:!: When [[client_compiling|compiling the client]] , a #define CLIENT_LIBDIR may be available to set a default //client_libdir// .
  
 +While parsing((keys.c:parse_keybind_line() )) the keys file, lines beginning with the number sign **#** and starting with a **new-line** are ignored.
client/keys.1522587400.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki