Page 1 of 1

Changing keys inflicts mouse control

PostPosted: Thursday, 10th March 2011, 10:24
by Dainem
Hello everybody!

I have a little problem about the interface: I am using a german keyboard. Therefore the z and the y keys are changed. So I looked for an option to change the keys. After reading some posts I created a makro.txt to change y and z keys.
This method works very well when I am only using the keyboard. Unfortunately this conflicts my mouse controls: when I am leftclicking on the upper left field the game asks me to cast a spell. It seems to me that left clicking on this field interprets the game as pressing the "y" key which I have changed via makro.txt to z.
Is there a way to use the z key as the y key while not inflicting mouse control? I also tried changing the "h" and "j" keys with "y" and "u" but this completely ruins mouse control.

I hope I could descripe my problem. I am using the latest 0.8 windows tiles version. I couldn´t find a solution in the wiki and in this forum.

Greetings from Germany

Dainem

Re: Changing keys inflicts mouse control

PostPosted: Thursday, 10th March 2011, 19:53
by danr
Some work-around ideas:

You could use the keytweak program for Windows to remap your keyboard.

Or you could get a cheap USB keyboard with a US English layout and plug that in for playing Crawl.

Re: Changing keys inflicts mouse control

PostPosted: Thursday, 10th March 2011, 20:27
by jpeg
Dainem wrote:I have a little problem about the interface: I am using a german keyboard. Therefore the z and the y keys are changed. So I looked for an option to change the keys. After reading some posts I created a makro.txt to change y and z keys.
This method works very well when I am only using the keyboard. Unfortunately this conflicts my mouse controls: when I am leftclicking on the upper left field the game asks me to cast a spell. It seems to me that left clicking on this field interprets the game as pressing the "y" key which I have changed via makro.txt to z.
Is there a way to use the z key as the y key while not inflicting mouse control? I also tried changing the "h" and "j" keys with "y" and "u" but this completely ruins mouse control.

Ouch. That really shouldn't happen. Could you please post a bug report on our tracker? https://crawl.develz.org/mantis/bug_report_page.php
The account is the same as the forum one.

I myself have gotten so used to the odd y placement that I never even tried to macro it elsewhere. (Well, that and I hardly ever move by mouseclick.)
I can't really think of any workarounds right now. Might be best to ignore the y if you're moving a lot by mouseclick anyway. Sorry.

Re: Changing keys inflicts mouse control

PostPosted: Thursday, 10th March 2011, 21:59
by jpeg
I just remembered: key bindings should do the trick. Add the following lines to your init file:
  Code:
bindkey = [y] CMD_CAST_SPELL
bindkey = [Y] CMD_FORCE_CAST_SPELL
bindkey = [z] CMD_MOVE_UP_LEFT
bindkey = [Z] CMD_RUN_UP_LEFT
bindkey = [^z] CMD_OPEN_DOOR_UP_LEFT


If you want to remap any other keys, see docs/keybind.txt for the required command keywords. That file hasn't been updated in a while, so if you need any commands not included, just ask away. :)

And hey, I literally had to get up again and start up the computer when the idea occurred to me. I guess I really don't like leaving any questions unanswered. :D

Re: Changing keys inflicts mouse control

PostPosted: Friday, 11th March 2011, 00:06
by Dainem
@ jpeg: Thanks alot! Using the init.txt instead of the makro.txt doesn´t inflict mouse control so I can use the z key for moving up left .

One little question: I don´t need the h,j,k,l buttons because I always use the arrow keys. Therefore I´d like to to put "Move up left" to "h" and "Move up right" to "j". When I now add your bindkeys to the init.txt and only change "z" with "h", the keyboard works, but using the mouse is again inflicted (clicking on the left field makes the player going up and left). Why is mouse control working with "z" but not with the "h" or the "j"?


Dainem

Re: Changing keys inflicts mouse control

PostPosted: Monday, 14th March 2011, 15:05
by jpeg
I've now fixed the underlying issue of mouseclicks being translated back to vi keys, which are in turn translated to the actual commands. That was a completely pointless detour and the only reason no one noticed it was buggy before you did is that, apparently, most Tiles player don't bother with macros and keybindings, at least for the movement keys. Both macros and keybindings should now have the desired effect.

Once CDO updates (might take a day or two), feel free to experiment with your settings and shout if you notice any other oddities.

Vielen Dank für den Hinweis! :D