|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Disclaimer |
This article is intended for Bronco, and has been based
on the COW client (version 1.03, patch level 1), though it should
work for most other Bronco clients as well.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Acknowledgement |
A lot of information comes from the COW documentation,
hence we are indepted to all people who contributed to the COW client.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Contents |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Introduction |
This article describes what a keymap is and how you can design one
that best suits your needs.
All Netrek clients have a default mapping
of keys to actions.
For example, the key _ (underscore) is mapped to the action
turn on tractor beam. Of course, this key is kind of hard to
reach during tight combat. To adjust the keymap to your personal
preferences, clients provide a way to alter the default key layout.
In this article you will learn more precisely what a keymap is, how it can be changed and how you can design a keymap that suits your needs. We are not going to tell you that a certain keymap is the one best keymap. We will merely try to hand you the necessary information you need to design your own keymap.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| How to specify a Keymap |
This chapter will explain how you can specify your keymap. It not only
covers the keymap syntax, but also the control-keymap, buttonmaps,
mouse-as-shift, and all other things you can use to create the keymap
you want.
Keymaps can be defined in the options window (shift-O by default) or in your .xtrekrc. We would not recommend that the options window be used as it has very limited space and requires altering every game. To set up a .xtrekrc just create a file of that name in your home directory with personal read permissions set for it (if you are not using UNIX just check the documentation that came with the client for the proper name and place of the xtrekrc-file). A .xtrekrc only acts on changes in the defaults, so a blank .xtrekrc should not affect your client in any way. For remapping keys in the options window use the form 'xy' where 'y' is the default key of the action that you wish to now be in position 'x' on the keyboard. So, if in the default keymap 'y' invokes action 'do y' and 'x' invokes 'do x', then after remapping 'y' to 'x', 'x' will invoke the action 'do y'. For example: keymap: xy This will make the key 'x' act as pressor toggle, the key 'y'. Note that 'y' will invoke 'do y' too, until you map another action onto it. Also note that you no longer can invoke 'do x', since there is no key that invokes that function. To make 'z' invoke 'do x', add 'zx' to your keymap. As you can see it is possible to make certain actions unreachable: if 'q' invokes fast quit and you never want to use that action (i.e. to prevent quitting out of the game by accident), you just map 'q' to some other function, and you do not map any key to 'q' (i.e. you don't have anything of the form <key>q in your keymap). For multiple entries use the form 'xyabcd'. If you are using a .xtrekrc the form is similar but you need a command line. The command line for the basic keymap is:
keymap: xyabcd It is possible to remap <space>. The next keymap maps 'x' to <space>:
keymap: x i.e.
keymap: <space>x Be careful though: if you put two spaces at the end of the keymap, <space> would be mapped upon itself, and would override the mapping of 'x': Best is to put <space> somewhere in the middle of your keymap, for clarity. Like this for example:
keymap: tT x It is also possible to map <shift><key> combinations:
keymap: xYYx Here x will invoke <shift>y (Y) and <shift>y will invoke x, i.e. the functions have been swapped. As well as the normal keymap, keymaps can be specified for individual ship types by using the suffix '-??' where '??' is the two letter code of the ship (sc for scout, dd for destroyer, ca for cruiser, bb for battleship, as for assault ship and sb for starbase). e.g. For a Starbase:
keymap-sb: xyabcd The individual ship keymaps act in addition to the basic keymap, so that you can have both but the specific ship keymap takes precedence. Ship specific keymaps alone can be used and may reduce confusion as to where each key is defined. Whenever you refit into a new shiptype, the keymap for that shiptype becomes active. One caveat: if you try to refit into a starbase and that fails (for example, because it has not been build yet), some clients still load the starbase-keymap. In order to get your CA-keymap back, you need to refit into a CA, in spite of the fact that you are already in a CA! On top of these there are <ctrl> keymaps. These allow you to map <ctrl> characters. They will also deal with the normal keys. That means you can use ckeymap to map all your keys, both normal and <ctrl> keys, and omit keymap altogether. Special case: the '^' must be mapped with a double ^ ("^^") in either the bound or binding key position. (It should be noted that <space> can be mapped as a <ctrl> function but not as <shift> function). The command line for these is:
ckeymap: ^xy^a^b^C^def Here <ctrl>x is mapped to y; <ctrl>a to <ctrl>b, <shift><ctrl>c to <ctrl>d and e to f. <ctrl> keymaps can also be set for individual ships, e.g.:
ckeymap-sb: ^xy^a^b^C^d All these can be used together in your .xtrekrc, with the ckeymap taking precedence over the normal keymap. In case you thought that remapping almost any key on the keyboard to almost any other was all there was to it, there is also a buttonmap. This maps buttons on your mouse and includes a facility for <shift> and <ctrl> to activate further mouse functions. If you do not wish to use more than the 3 basic functions it may be advisable to add the following line to your .xtrekrc:
shiftedMouse: off because the default value for shiftedMouse is on. So you can remap the mouse buttons with a buttonmap line of the form:
buttonmap: 1*2*3*4*5*6*7*8*9*a*b*c* Where * is the key you want to be mapped and:
The important thing to note with buttonmaps is that keymaps take precedence. This means that if you have a buttonmap line the keys it takes as functions are the remapped ones from your keymap. I.e. don't put in a buttonmap: 1t2p3k if you have mapped t, p or k in your keymap. However the default buttonmap will operate, no matter what your keymap, as long as there is no buttonmap: line. So you should make sure that you use the mapped keys rather than the default keys when creating your buttonmap. Also see the tips section below. Even this is not the entirity of it. You can also use mouse buttons as a form of shift in order to get more functions from your normal keys. Each button on the mouse gives a different set of functions. You will need the following in your .xtrekrc:
mouseAsShift: on Then each of the buttons has it's own keymap, e.g:
b1keymap: xyabcd Where if 'x' is pressed with button 1 then 'y' occurs, if pressed with button 2 'r' occurs and with button 3 'u' occurs. Where 'y', 'r' and 'u' are the default keymap functions. It is also possible to use a mixture of buttonkeymaps and the normal buttonmap. If you do not specify b3keymap, for example, the right mouse button will still have its default function, i.e. set course. This section deals with the binding of macro's and RCD's (Receiver Configurable Distresses) to keys. For more details on how to use and write macro's and RCD's please consult other sources. Macro's can be sent by hitting the enter macro mode key (defaults to 'X') followed by a key that determines the macro. Macro's are specified as follows:
mac.<key>[.<destination>]: <macro code> So hitting <enter macro mode> followed by <key> will cause the macro to be sent to <destination>. If you do not specify a destination, your client will ask you to provide one after hitting enter macro mode<key>. Distresses are specified like this:
dist.<key>.<distress name>: <distress code> RCD's can be sent as shown in Appendix B, just press the key(s) while holding your mouse pointer in either the tactical or the galactic display. If you want a key to send a macro directly, without the need of entering macro mode, use:
singleMacro: abC This will cause the macro's or RCD's bound to a, b and C to be sent as soon as you hit a, b or C. Note that the default RCD's can all be sent both with and without the enter macro mode. Concluding As we have seen we can map up to 7 actions (e.g: a, A, ^a, ^A, button1-a, button2-a, button3-a) to one key using keymap, ckeymap and mouseAsShift. Using a buttonmap we can map up to 4 actions to one mouse button, in combination with <shift>, <ctrl> and <shift>+<ctrl> (e.g: button1, <shift>button1, <ctrl>button1 and <shift><ctrl>button1). So we really have plenty of choice where to map our actions to.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Designing your Keymap |
Having seen how a keymap works, you now have to try and produce one that
suits your needs. This is harder than it appears and it might take
several hours to achieve a good result, but it will be time well spent.
To design and implement your keymap, you will need to take the following
steps:
Take note of any restrictions that will be posed upon your keymap. Restrictions may be:
After we have determined the restrictions, we now move on to our demands: what do we want? As we have seen in the previous section there are some design rules that apply to all keymaps. So we will assume that you have one hand operating the mouse and one hand operating the keyboard. The keyboard hand will have a home position. Obviously, the fingers of the keyboard hand also have a home position. First, we will try to make a list of requirements our new keymap will have to fulfill as well as possible. It is your task to decide what aspects you find important and assign priorities to the different requirements. Make a note of all the functions that you use and decide on their relative importance to you. However, there are some general principles which could be useful.
Now that you have made up a list of requirements, it is time to design a keymap that will fulfill those requirements, and that will not violate the restrictions. One thing that is making the design of a keymap particularly difficult is the fact that there are so many keys, all asking for an easy to reach and easy to remember place! One way to deal with this problem is using a divide and conquer strategy. There are two ways to use the divide and conquer strategy, the first being to divide all actions into different sets of actions depending on their type (e.g. combat actions, manouvering actions, communication, keys to bring up pop-up windows, etc.) and the second being sets that depend on the different modes of playing state we can identify, for example carrying or not, (scout-)bombing or not, basing or not, cloaking or not, etc. First we divide all actions in groups using the purpose of the action as criterium. For example, we can group the actions in categories for manouvering, for combat, for communication, for pop-ups, etc. One possible grouping is given in appendix A. We then can decide to use a certain group (or type of) keys to map the actions from a specific group. For example, we could decide to use <ctrl> combinations for macro's and distress signals and use <shift><ctrl> combinations for multiline macro's. To discover different modes, look at your playing style. Different modes could be: carrying or not carrying, scout-bombing or not scout-bombing, basing or not basing, cloaked or not cloaked, etc. One way to implement different modes is the use of <shift>, <ctrl>, and mouseAsShift. This does imply that you have <shift> and <ctrl> under your fingers, i.e. the home position of your left hand will be quite far on the left side of your keyboard. And that limits the number of keys you can operate with your left hand. One way to circumvent this is to use <Caps Lock>. For example: When you want to use one set of actions when being cloaked and another set when not cloaked, you can use <Caps Lock> to toggle between the two modes. Of course this implies that the one set consists of all lower case keys and the other set of all upper case keys. Another possible way is to have two different home positions for your hand depending on what you are doing. For Example: a s d f when uncloaked and j k l ; when cloaked.
APPENDIX A: The Default KeymapThe following list contains the default keymap from the COW-client. It has been partitioned for easy reference.
APPENDIX B: RCD'sThese are the default RCD's (Receiver Configurable Distresses) from the COW client.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||