Hotkeys for Movements / Mouse Interaction

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
bernd
Posts: 7
Joined: January 17th, 2018, 7:20 pm

Hotkeys for Movements / Mouse Interaction

Post by bernd »

Hi there,

just started to play Wesnoth a couple of days ago and was really surprised to having to use the mouse all the time. Would have expected for a game probably developed by a big community of techs to have shortcuts for everything.
Please dont misunderstand me, the game seems great and you can see the uncountable hours of work involved.
It simply would be a lot more comfortable to be able to play it with a wireless keyboard sitting on my couch :D
Googling around I found quite a lot old ideas / requests in this direction (e.g. this or that), but it seems none led to success.

So here is my dream:
Customizable hotkeys for moving the "focused" (clicked) hex on the map and for simulating left-click and right-click (e.g. "primary action" and "secondary action").

As these are by far the most common interactions it would increase the usability vastly.
If moving in 6 directions would be supported defaults could be QWEASD for example.
But using the arrow keys or others for 4 direction movement should not be a problem either, simply by alternating north/south at sideward movement.

What do you think?
bernd
Posts: 7
Joined: January 17th, 2018, 7:20 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by bernd »

0 % "Nay" means 100 % "Yay", doesn't it? Then let's implement! ;)
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Hotkeys for Movements / Mouse Interaction

Post by octalot »

There's partial joypad support already in the engine, with the concept of the "focused" hex already implemented. But AFAICS, the joypad buttons aren't supported yet, so it still needs mouse-clicks to play the game.

The preferences to enable joystick support are hidden, you have to remove the

Code: Select all

#ifdef __UNUSED__
in data/advanced_preferences.cfg.

Edit: viewtopic.php?f=6&t=34205 joystick users should bind hotkeys to "left mouse click" and "right mouse click", but that seems to have bitrotted (those strings are now only found in the translation files, not the .cpp files themselves). Trying to bind joypad buttons to hotkeys also seems to be non-functional in trunk, the 'add hotkey' dialog responds to the button press, but the button doesn't trigger the function afterwards.
User avatar
SFault
Posts: 483
Joined: November 10th, 2009, 2:21 pm
Location: Esbo, Finland

Re: Hotkeys for Movements / Mouse Interaction

Post by SFault »

Why not use wireless mouse also?

I think the main problem with the idea is that keyboard work nicely in 4 or 8 directions but the game uses 6 direction grid. If you can come up with an idea that allows selecting hexes in easy way then somebody might implement it. But atm it would need also a great design effort first.
segmentation fault
EBfW, GtR, Art, Old art
bernd
Posts: 7
Joined: January 17th, 2018, 7:20 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by bernd »

@octalot
Thanks for the info. But if I understand you correctly, it does not work atm? Could not test it yet

@SFault
Wireless mouse is quite less handy sitting on a sofa than pure keyboard :)
About the idea for 6 directions, what about the ones in the first post:
bernd wrote: January 17th, 2018, 8:05 pm If moving in 6 directions would be supported defaults could be QWEASD for example.
But using the arrow keys or others for 4 direction movement should not be a problem either, simply by alternating north/south at sideward movement.
using the four arrow keys sideways movement could look s.th. like this:
Image
(just imagine the image turned by 90°)
Last edited by bernd on February 26th, 2018, 7:52 pm, edited 1 time in total.
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Hotkeys for Movements / Mouse Interaction

Post by beetlenaut »

@bernd: Your hex grid is rotated 90 degrees.
SFault wrote: February 24th, 2018, 5:59 amkeyboard work nicely in 4 or 8 directions but the game uses 6 direction grid.
But keys are arranged in little hexes, not rectangles. If you put your middle finger on O , then the letters around it, Z, A, W, E, D, and X map very nicely to a hex grid. (For BfW, you have to turn your wrist so that E and Z are up and down.) You could also use the 10-key pad. 8 and 2 go up and down, and the corners go diagonally right and left. Bernd suggested QWEASD too, which is also six. Our six-directional grid is not the problem. The string freeze we are under might be though.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Hotkeys for Movements / Mouse Interaction

Post by Celtic_Minstrel »

I think it's probably possible already to remap mouse clicks to a keypress in the hotkey preferences. Moving the focused hex, on the other hand... I don't know of any way to do that right now.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
psymin
Posts: 3
Joined: November 10th, 2009, 3:57 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by psymin »

bernd wrote: January 17th, 2018, 8:05 pm So here is my dream:
Customizable hotkeys for moving the "focused" (clicked) hex on the map and for simulating left-click and right-click (e.g. "primary action" and "secondary action").
I love the idea. This would be a huge step forward for accessibility as well as for community Steam Controller configurations with keyboard input mapped to buttons.

I'm not able to help much, but I can test and I can contribute to a bounty.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by josteph »

If you're on Windows you can use mouse keys to perform mouse actions using the keyboard.

Or you might consider using wireless touchpad.
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Hotkeys for Movements / Mouse Interaction

Post by Celtic_Minstrel »

Moving the cursor itself with the keyboard is still not a great option though; it's better if the game can implement its own keyboard navigation. For example, with mouse keys you'd need to move the cursor by pressing and holding keys, then press some other key to simulate a click, all just to move the selection to the next adjacent hex. If moving the selection is implemented directly into the engine, all that would be reduced to a single keypress.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by josteph »

Yes, an application-level implementation has advantages over an OS-level one. On the other hand, the OS-level implementation has the advantage that it's available right now, whereas an application-level implementation would have to be designed, implemented, and released. :hmm: (It wouldn't be hard to implement, but somebody would have to do it.)

To be honest, I think mouse keys and keyboard navigation are both inferior to a real mouse/touchpad. Just imagine capturing villages without using the mouse; doing that with only 4 or 6 directional commands will be a pain, I think. Also, without a mouse it's not possible to view a unit's resistances as modified by the unit's traits and objects, or to open the damage calculations dialog.
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Hotkeys for Movements / Mouse Interaction

Post by Celtic_Minstrel »

josteph wrote: March 12th, 2019, 3:10 am Also, without a mouse it's not possible to view a unit's resistances as modified by the unit's traits and objects, or to open the damage calculations dialog.
Well, yeah, navigation is far from the only think inaccessible without a mouse... all those tooltips! But that's no reason not to try to improve the situation. I don't think navigating the hex grid with the keyboard would be all that hard, honestly, though it's probably at least a little inferior to an actual mouse.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by josteph »

Celtic_Minstrel wrote: March 12th, 2019, 4:48 am Well, yeah, navigation is far from the only think inaccessible without a mouse... all those tooltips! But that's no reason to try to improve the situation.
Sure. If someone wants to implement a keyboard mode, I'd be happy to give pointers.
Fractal
Posts: 10
Joined: May 2nd, 2018, 2:30 am

Re: Hotkeys for Movements / Mouse Interaction

Post by Fractal »

Hint-based navigation similar to what is done in Qutebrowser or Vimium are quite efficient to jump from one point to another with the keyboard.

Something like that : https://qutebrowser.org/doc/img/hints.png

It would give the possibility to select tooltips too, but, that solution is not very accessible.
Mawmoocn
Posts: 154
Joined: March 16th, 2019, 3:54 pm

Re: Hotkeys for Movements / Mouse Interaction

Post by Mawmoocn »

Disclaimer: This is a hypothesis on how it could be made as a feature. I personally think keyboard gameplay would be hard without some memorization of features and it needs other supporting mechanisms to work seamlessly. I use a mouse but I can’t say for certain if I’ll play using a keyboard if this was made into a feature.


To make keyboards work for Wesnoth, I assume it would need 3 core features and 2 of them might be new.


1. Selecting units on the map by the use of keyboard
2. Easy movement for selecting units
3. Toggle of movement and attack functionality


1. Selecting units on the map by the use of keyboard

Navigation is achieved by the use of arrow keys.

Selecting units would need a pointer of hex base selection which consists of seven tiles that depends on tile placement.

Seven tile selection is necessary for less accurate aim when using the keyboard.

Tile selection would need a "moving island" that is mainly controlled by arrow keys.

The hotkeys used for selecting inside a "moving island" would consist of top hex tile selection, middle hex tile selection, and bottom hex tile selection.


Hotkeys are necessary for unit selection inside the "moving island", it will imitate mouse clicks.

"Moving island" is a moving platform, that uses 7 tiles and can emulate as a mouse or a pointer, using a keyboard. Basically it’s a tool use for aiming units without the need of keyboard.

The hotkeys use QWE (top), S (middle), and AXD (bottom). This could be changed in the hotkey menu if customising was an option.

2. Easy movement for selecting units

There are two main types of movement, map scrolling and moving platform placement inside the map(acts like a mouse pointer without a mouse).

Scrolling of maps is dependent on zoom size and how well you can aim any units assuming speed is calibrated to aim.

Moving platform by default will be placed on the center of your game screen.

Moving platform can be moved by arrow keys, but the aim or it’s pointer, will always remains at the center, like how sniper scopes or telescopes work in real life.

Platform’s center position can be changed by the use of a toggle (ctrl/shift/alt or any hotkey) and arrow keys. By default, using a toggle and arrow keys will only move moving platform’s position and not the whole map.

The reason for this is to aim dead zones, a center position couldn’t target, especially on small maps.


3. Toggle of movement and attack functionality

Every unit has different move speed, selecting and moving your unit would be hard without modifying it to respond to keyboard.

Selecting a unit will modify the behaviour of arrow keys to reach only as far as the unit can go, for the current selected unit. If used with next unit(hotkey n), this would probably make placement of units faster than planned.

Selecting an attack inside attack enemy is possible with the use of arrow keys and enter key.

Toggle could do various features with the use of hotkeys, basically optional.
It could emulate right click, and provide tooltip information once the corresponding hotkey has been pressed.


I think there could be some glitches that could break functionality if this was implemented. As an example, arrow key movement might not respond to toggle and other conditions to change based on action.


Good luck to everyone! I’ll try to answer any questions relating to this topic, if I have time to spare.
Post Reply