overlapping keys

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
filbo
Posts: 788
Joined: Fri Jun 20, 2014 10:06 am

overlapping keys

Post by filbo »

My oldest child heard some music the other day which reminded them of Rocks'n'Diamonds, so they set out to install it on their Debian 'sid' laptop. They downloaded the Linux install from artsoft.org, but didn't understand how to finish the job, and I interrupted and said let's see what's in the repository -- which turned out to be 4.3.8.2, the current release version, so I guided to install that instead.

Anyway, once it was installed they went through settings, then tried to play -- but found that the 'go right' movement key didn't work! After some rechecking, it turned out they had fumbled the keyboard at one point and ended up setting the 'single step' key to right-arrow -- same as they'd set 'go right'.

At first we thought it was somehow a build or config bug in the Debian package, but once we found the right setting they remembered the keyboard bobble at that point, so that's the probable cause.

BUT, there is clearly a RnD bug in play. It should Do Something to prevent this sort of situation. Probably not absolutely prevent any two UI keys from being set the same; but some sort of intervention. Some ideas:

- when setting one key the same as another, pop up an 'are you sure?' dialog

- similar dialog when when exiting the key setup area, if two actions are mapped to the same key (and maybe remember, on a per-pair basis, that it has been 'approved'?)

- some sort of heads-up indicator that at least one key is double-mapped, plus a menu choice to 'show double-mapped keys'

Trying to find a good balance between letting people do this intentionally, while also helping people who do it by mistake, and neither one having a really annoying time of it!
filbo
Posts: 788
Joined: Fri Jun 20, 2014 10:06 am

Re: overlapping keys

Post by filbo »

I ran across this moderately old post of mine while searching for answers for another post, and -- Holger, did you ever address this in software, if not in reply here?
User avatar
Holger
Site Admin
Posts: 4528
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: overlapping keys

Post by Holger »

Hi filbo,

I feel very sorry about apparently having overseen this post for two years, and about R'n'D causing some trouble and wasted time to your child! :o

The only excuse I can think of is that it was at a typical holiday time (July), so I might therefore have overseen it. :(

OK, about the issue you have reported: Could you think of any practical situation where it would make sense to have two key shortcuts defined to the same key binding? (It could be possible if two key shortcuts would only be used on two different screens, but I'm not sure if such key shortcuts exists in R'n'D.)

So it may be easiest to just prevent defining overlapping key shortcuts at all. This seems to be better than later being able to check which key bindings have been used for which key shortcuts, and check for overlapping definitions manually.

The only extra functionality needed here would be an ad-hoc list of all key shortcuts that are currently in use, and check them against the currently chosen new key binding (and then tell the user "Key shortcut already in use!" or something).

What do you think about it?
filbo
Posts: 788
Joined: Fri Jun 20, 2014 10:06 am

Re: overlapping keys

Post by filbo »

I can't think of where / why someone might want two actions bound to one key, but I think it would be a mistake to absolutely prevent it.

But, preventing it in the config UI is probably OK. For whatever obscure purpose I'm not quite thinking of, one could edit the same-key bindings directly into setup.conf. As long as the initialization code reading that file doesn't reject it.

No worries about my kid's issue. We had figured it out and fixed it well before I made the post.

(This does remind me of a tiny issue I think I mentioned once before: that afaik RnD doesn't have a key binding for 'quit'. To quit from the main menu one must arrow and choose the right option, can't hit Ctrl+Q or whatever it might be bound to. Which just seems like a small oversight...)
Post Reply