Jimaklass
12-30-2011, 12:01 PM
I had always the problem of casting the right spell at the right moment, especially on critical game situations where danger was getting too close to me. Using the mouse to cast spells has an obvious disadvantage: you lose precious time and you lose control of your character's facing. Having watched some videos of good players on youtube, i noticed that they were able to use the keyboard for most spells but i simply lack this ability for spells bound to keys 6 to 0 (the last 5 spells of the spell bar). On top of that was the burden of changing bars with mouse wheel (lose even more time) since my keyboard doesn't help me with the keys F1-F2 (they are kinda high for me so i had to lift my hand off the keyboard and i could barely coordinate all actions at once). The result was slow casting, even pressing the wrong buttons sometimes, which ended with me casting the wrong spell and in general: awkward gameplay.
The obvious solution was to bind those spells (6, 7, 8, 9, 0) and shortcuts (F1, F2) to other keys more suitable for myself so i could have instant access to them with minimal errors. Unfortunately, the game does not allow to bind those keys to different alternatives, either through the gui or in the game.cfg file. It seems those keyboard bindings are hardcoded to the game. The workaround is to think the opposite way. So you may not be able to change those bindings but you can change your keyboard behavior ;)
This thread (http://www.regnumonline.com.ar/forum/showthread.php?t=47793) deals with similar issues and maybe one could extend that work to patch his/her own keyboard behavior. Here i propose a different approach for what it's worth, one that does not require you to patch and compile anything. My workaround might not resolve all issues of the above thread and this is not my purpose. The goal is to have several keys you need in a position that will allow you to instantly access them.
The idea is to instruct your keyboard to produce output different than the default. For example, in my setup i use the keys Q and E instead F1 and F2 and the keys Z, X, C, R, F instead 6, 7, 8, 9, 0. Here is the procedure you need to follow in order to setup your keyboard as needed:
Open a terminal and issue the command
xmodmap -pke > xmodmap-default
This will create a file named "xmodmap-default" containing the instructions of your current keyboard settings. Edit this file with a text editor and delete all the lines except for the ones that correspond to the letter keys (the file should then contain exactly 26 lines). Save the file:
keycode 24 = q Q semicolon colon periodcentered
keycode 25 = w W Greek_finalsmallsigma Greek_SIGMA
keycode 26 = e E Greek_epsilon Greek_EPSILON EuroSign
keycode 27 = r R Greek_rho Greek_RHO registered
keycode 28 = t T Greek_tau Greek_TAU
keycode 29 = y Y Greek_upsilon Greek_UPSILON
keycode 30 = u U Greek_theta Greek_THETA
keycode 31 = i I Greek_iota Greek_IOTA
keycode 32 = o O Greek_omicron Greek_OMICRON
keycode 33 = p P Greek_pi Greek_PI
keycode 38 = a A Greek_alpha Greek_ALPHA
keycode 39 = s S Greek_sigma Greek_SIGMA
keycode 40 = d D Greek_delta Greek_DELTA
keycode 41 = f F Greek_phi Greek_PHI
keycode 42 = g G Greek_gamma Greek_GAMMA
keycode 43 = h H Greek_eta Greek_ETA
keycode 44 = j J Greek_xi Greek_XI
keycode 45 = k K Greek_kappa Greek_KAPPA
keycode 46 = l L Greek_lamda Greek_LAMDA
keycode 52 = z Z Greek_zeta Greek_ZETA
keycode 53 = x X Greek_chi Greek_CHI
keycode 54 = c C Greek_psi Greek_PSI copyright
keycode 55 = v V Greek_omega Greek_OMEGA
keycode 56 = b B Greek_beta Greek_BETA
keycode 57 = n N Greek_nu Greek_NU
keycode 58 = m M Greek_mu Greek_MU
Back to terminal:
cp xmodmap-default xmodmap-regnum
Now you have a copy of that file with the name "xmodmap-regnum". Again, use your text editor to edit this file. Each line of this file is an expression that instructs your windowing system on the desired behavior of a certain key of your keyboard. The expression, depending on the key, is one of the following forms:
keycode XXX = keysym1 keysym2 keysym3 keysym4
keycode XXX = keysym1 keysym2 keysym3 keysym4 keysym5
We will be editing only the first 2 keysyms of each line. The 1st corresponds to the output of the key when pressed alone and the 2nd to the output of the key when pressed with SHIFT (or with CAPS LOCK on). For the setup i mentioned above you just need to edit the keysyms of the keys Q, E, Z, X, C, R, F as in this example:
keycode 24 = F1 q semicolon colon periodcentered
keycode 25 = w w Greek_finalsmallsigma Greek_SIGMA
keycode 26 = F2 e Greek_epsilon Greek_EPSILON EuroSign
keycode 27 = 9 r Greek_rho Greek_RHO registered
keycode 28 = t t Greek_tau Greek_TAU
keycode 29 = y y Greek_upsilon Greek_UPSILON
keycode 30 = u u Greek_theta Greek_THETA
keycode 31 = i i Greek_iota Greek_IOTA
keycode 32 = o o Greek_omicron Greek_OMICRON
keycode 33 = p p Greek_pi Greek_PI
keycode 38 = a a Greek_alpha Greek_ALPHA
keycode 39 = s s Greek_sigma Greek_SIGMA
keycode 40 = d d Greek_delta Greek_DELTA
keycode 41 = 0 f Greek_phi Greek_PHI
keycode 42 = g g Greek_gamma Greek_GAMMA
keycode 43 = h h Greek_eta Greek_ETA
keycode 44 = j j Greek_xi Greek_XI
keycode 45 = k k Greek_kappa Greek_KAPPA
keycode 46 = l l Greek_lamda Greek_LAMDA
keycode 52 = 6 z Greek_zeta Greek_ZETA
keycode 53 = 7 x Greek_chi Greek_CHI
keycode 54 = 8 c Greek_psi Greek_PSI copyright
keycode 55 = v v Greek_omega Greek_OMEGA
keycode 56 = b b Greek_beta Greek_BETA
keycode 57 = n n Greek_nu Greek_NU
keycode 58 = m m Greek_mu Greek_MU
Notice that i use the 2nd keysym to produce non-capital letters for all the letter keys. This way i cannot type any capital letters at all with this setup :D This is the downside of this configuration. Since i changed the 1st keysym to work as i need it i lost the ability to type with that key. For this reason i moved the default key behaviour to the 2nd keysym (so i can type in chat the letters q, e, z, x, c, r, f) and i changed the 2nd keysym of all keys accordingly so i don't have to selectively press SHIFT just for those keys. That's ok, i can live with it :tonguey:
With those 2 files you can now switch between the 2 configurations:
xmodmap xmodmap-regnum
gives you the altered behavior, while
xmodmap xmodmap-default
reverts your keyboard to what it should be ;)
Some notes:
If your account password includes capital letters don't use the altered behavior before you log in.
You must have the CAPS LOCK key on in order to type in chat box. In fact, it is best if you have CAPS LOCK on all the time when you use the altered behavior. Even then you will not be able to type capital letters.
In order to circumvent the above issue i use "yakuake". It is a KDE terminal application that remains hidden on the top of your screen until you press a button (like the console of quake-like games). With it i can switch keyboard behaviors on the fly as i play the game in windowed mode. Another solution would be to use "xbindkeys" to assign the "xmodmap" commands to mouse events.
If you use the exact configuration i mention above, you also need to use alternative keys for autorunning and resting. I use G and T respectively.
If you have a mouse with extra buttons (gaming mouse) you can use the programs "xbindkeys" and "xvkbd" to assign keystrokes to mouse events. I don't need such a workaround myself since my mouse (http://www.roccat.org/Products/Gaming-Mice/ROCCAT-Kova-/) is fully supported under linux but i can write here a how-to if people are interested ;)
I hope this approach helps people to improve their gameplay experience. It does not mess with your system libraries, it doesn't require you to patch and compile code, it only uses the "xmodmap" program and 2 plain text files to switch between keyboard configurations. Regards ;)
The obvious solution was to bind those spells (6, 7, 8, 9, 0) and shortcuts (F1, F2) to other keys more suitable for myself so i could have instant access to them with minimal errors. Unfortunately, the game does not allow to bind those keys to different alternatives, either through the gui or in the game.cfg file. It seems those keyboard bindings are hardcoded to the game. The workaround is to think the opposite way. So you may not be able to change those bindings but you can change your keyboard behavior ;)
This thread (http://www.regnumonline.com.ar/forum/showthread.php?t=47793) deals with similar issues and maybe one could extend that work to patch his/her own keyboard behavior. Here i propose a different approach for what it's worth, one that does not require you to patch and compile anything. My workaround might not resolve all issues of the above thread and this is not my purpose. The goal is to have several keys you need in a position that will allow you to instantly access them.
The idea is to instruct your keyboard to produce output different than the default. For example, in my setup i use the keys Q and E instead F1 and F2 and the keys Z, X, C, R, F instead 6, 7, 8, 9, 0. Here is the procedure you need to follow in order to setup your keyboard as needed:
Open a terminal and issue the command
xmodmap -pke > xmodmap-default
This will create a file named "xmodmap-default" containing the instructions of your current keyboard settings. Edit this file with a text editor and delete all the lines except for the ones that correspond to the letter keys (the file should then contain exactly 26 lines). Save the file:
keycode 24 = q Q semicolon colon periodcentered
keycode 25 = w W Greek_finalsmallsigma Greek_SIGMA
keycode 26 = e E Greek_epsilon Greek_EPSILON EuroSign
keycode 27 = r R Greek_rho Greek_RHO registered
keycode 28 = t T Greek_tau Greek_TAU
keycode 29 = y Y Greek_upsilon Greek_UPSILON
keycode 30 = u U Greek_theta Greek_THETA
keycode 31 = i I Greek_iota Greek_IOTA
keycode 32 = o O Greek_omicron Greek_OMICRON
keycode 33 = p P Greek_pi Greek_PI
keycode 38 = a A Greek_alpha Greek_ALPHA
keycode 39 = s S Greek_sigma Greek_SIGMA
keycode 40 = d D Greek_delta Greek_DELTA
keycode 41 = f F Greek_phi Greek_PHI
keycode 42 = g G Greek_gamma Greek_GAMMA
keycode 43 = h H Greek_eta Greek_ETA
keycode 44 = j J Greek_xi Greek_XI
keycode 45 = k K Greek_kappa Greek_KAPPA
keycode 46 = l L Greek_lamda Greek_LAMDA
keycode 52 = z Z Greek_zeta Greek_ZETA
keycode 53 = x X Greek_chi Greek_CHI
keycode 54 = c C Greek_psi Greek_PSI copyright
keycode 55 = v V Greek_omega Greek_OMEGA
keycode 56 = b B Greek_beta Greek_BETA
keycode 57 = n N Greek_nu Greek_NU
keycode 58 = m M Greek_mu Greek_MU
Back to terminal:
cp xmodmap-default xmodmap-regnum
Now you have a copy of that file with the name "xmodmap-regnum". Again, use your text editor to edit this file. Each line of this file is an expression that instructs your windowing system on the desired behavior of a certain key of your keyboard. The expression, depending on the key, is one of the following forms:
keycode XXX = keysym1 keysym2 keysym3 keysym4
keycode XXX = keysym1 keysym2 keysym3 keysym4 keysym5
We will be editing only the first 2 keysyms of each line. The 1st corresponds to the output of the key when pressed alone and the 2nd to the output of the key when pressed with SHIFT (or with CAPS LOCK on). For the setup i mentioned above you just need to edit the keysyms of the keys Q, E, Z, X, C, R, F as in this example:
keycode 24 = F1 q semicolon colon periodcentered
keycode 25 = w w Greek_finalsmallsigma Greek_SIGMA
keycode 26 = F2 e Greek_epsilon Greek_EPSILON EuroSign
keycode 27 = 9 r Greek_rho Greek_RHO registered
keycode 28 = t t Greek_tau Greek_TAU
keycode 29 = y y Greek_upsilon Greek_UPSILON
keycode 30 = u u Greek_theta Greek_THETA
keycode 31 = i i Greek_iota Greek_IOTA
keycode 32 = o o Greek_omicron Greek_OMICRON
keycode 33 = p p Greek_pi Greek_PI
keycode 38 = a a Greek_alpha Greek_ALPHA
keycode 39 = s s Greek_sigma Greek_SIGMA
keycode 40 = d d Greek_delta Greek_DELTA
keycode 41 = 0 f Greek_phi Greek_PHI
keycode 42 = g g Greek_gamma Greek_GAMMA
keycode 43 = h h Greek_eta Greek_ETA
keycode 44 = j j Greek_xi Greek_XI
keycode 45 = k k Greek_kappa Greek_KAPPA
keycode 46 = l l Greek_lamda Greek_LAMDA
keycode 52 = 6 z Greek_zeta Greek_ZETA
keycode 53 = 7 x Greek_chi Greek_CHI
keycode 54 = 8 c Greek_psi Greek_PSI copyright
keycode 55 = v v Greek_omega Greek_OMEGA
keycode 56 = b b Greek_beta Greek_BETA
keycode 57 = n n Greek_nu Greek_NU
keycode 58 = m m Greek_mu Greek_MU
Notice that i use the 2nd keysym to produce non-capital letters for all the letter keys. This way i cannot type any capital letters at all with this setup :D This is the downside of this configuration. Since i changed the 1st keysym to work as i need it i lost the ability to type with that key. For this reason i moved the default key behaviour to the 2nd keysym (so i can type in chat the letters q, e, z, x, c, r, f) and i changed the 2nd keysym of all keys accordingly so i don't have to selectively press SHIFT just for those keys. That's ok, i can live with it :tonguey:
With those 2 files you can now switch between the 2 configurations:
xmodmap xmodmap-regnum
gives you the altered behavior, while
xmodmap xmodmap-default
reverts your keyboard to what it should be ;)
Some notes:
If your account password includes capital letters don't use the altered behavior before you log in.
You must have the CAPS LOCK key on in order to type in chat box. In fact, it is best if you have CAPS LOCK on all the time when you use the altered behavior. Even then you will not be able to type capital letters.
In order to circumvent the above issue i use "yakuake". It is a KDE terminal application that remains hidden on the top of your screen until you press a button (like the console of quake-like games). With it i can switch keyboard behaviors on the fly as i play the game in windowed mode. Another solution would be to use "xbindkeys" to assign the "xmodmap" commands to mouse events.
If you use the exact configuration i mention above, you also need to use alternative keys for autorunning and resting. I use G and T respectively.
If you have a mouse with extra buttons (gaming mouse) you can use the programs "xbindkeys" and "xvkbd" to assign keystrokes to mouse events. I don't need such a workaround myself since my mouse (http://www.roccat.org/Products/Gaming-Mice/ROCCAT-Kova-/) is fully supported under linux but i can write here a how-to if people are interested ;)
I hope this approach helps people to improve their gameplay experience. It does not mess with your system libraries, it doesn't require you to patch and compile code, it only uses the "xmodmap" program and 2 plain text files to switch between keyboard configurations. Regards ;)