Page 1 of 1

Add function to prevent accidental pressing both < and >

PostPosted: Wednesday, 16th January 2019, 17:43
by adamkad1
What title says, add some function that will make it so, if you press both < and >, the game will ignore the imput that acts second so you dont go up and immidiately down (or vice versa), because it ruins lives.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Wednesday, 16th January 2019, 18:15
by Nekoatl
That would be rather awkward to implement cleanly. Programs receive separate events for each keystroke (excepting modifiers like CTRL), so the program wouldn't see < and > being pressed at the same time, but one being pressed after the other. It can't just ignore the second keystroke either, because sometimes players legitimately want to backtrack across stairs, for example when a player descends to a new floor and is surrounded by nasty enemies that they would rather try to lure 1 at a time from a safer location than fight while surrounded.

If this is a problem that needs a solution, then at best, there could be a confirmation prompt on the second keypress, but I would want it to be optional, as I've never accidentally double-crossed a staircase, but I've done it intentionally many times.

Edit: Actually, it might be possible to check the status of the other key at the time when one is pressed, and if so, ignore it. It's been too long since I've messed with that functionality to remember if it's possible, but my guess is that it probably is.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Wednesday, 16th January 2019, 18:29
by advil
Technical issues aside (it would be kind of annoying to implement this), my immediate reaction is that there's only so many kinds of miskeys we can protect the player from, and that if this is a mistake you are regularly making, you might consider playing a bit more slowly :) . If that's not an option, perhaps consider reassigning one of the two somewhere else on the keyboard so they aren't adjacent.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Wednesday, 16th January 2019, 21:06
by runewalsh
Game should ask confirmation if going down- or upstairs happened to be the first action after using stairs, as it is often accidental.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Thursday, 17th January 2019, 00:08
by chequers
I wouldn't like confirmation for <> / ><, as that's quite a common action while stairdancing.

The option autofight_warning can possibly be generalised to help. A setting called minimum_key_delay could be created which would prevent processing sequential key presses with too little time between them (perhaps the default could be 100ms or so).

Re: Add function to prevent accidental pressing both < and >

PostPosted: Thursday, 17th January 2019, 01:20
by duvessa
This happens to me very often with the default controls.

My suggestion is to combine the two commands and only have one key bound to them by default. The same square can't have both an up and down staircase on it, so there's no need for two commands. Make '>' the default key for "interact with the feature on this square" (stairs, portals, altars, shops, etc) and don't bind '<' to anything by default. This prevents the miskey issue since if you press both < and > at once it is the same as just pressing >.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Thursday, 17th January 2019, 02:23
by Shard1697
How would you automatically path to up or down staircases from the X view then?

Also I'm curious in what situation people are running into this happening, I don't think it's ever happened to me.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Thursday, 17th January 2019, 14:39
by njvack
I've fat-fingered both < and > at the same time by accident a few times. For normal movement (which I occasionally mess up too) it's generally not a super big deal but stairs take a long time and moving across levels generally has much bigger consequences than moving a single square.

Regarding X (and G), I think you could still use < and > in those modes while using > to interact with features. It's a little weird but not that weird.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Thursday, 17th January 2019, 15:53
by VeryAngryFelid
As a person who sometimes fat-fingers < and > I still think always using > to use stairs will lead to more problems, it is easier to "double press" > than fat-finger < and >.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Thursday, 17th January 2019, 17:42
by Airwolf
Why not add a force_more_message?

Re: Add function to prevent accidental pressing both < and >

PostPosted: Sunday, 20th January 2019, 02:00
by delarado
I've never done what you describe, but I added the following to my RC a while ago

  Code:
force_more_message += comes? into view


Some people called annoying... And it can be tedious pressing space a bunch of times in big fights. However, it forces me to pause when I sometimes wouldn't have before and so I find it very useful.

Re: Add function to prevent accidental pressing both < and >

PostPosted: Sunday, 20th January 2019, 11:10
by Fingolfin
French keyboards have < and > on the same key (shift-separated)

Re: Add function to prevent accidental pressing both < and >

PostPosted: Sunday, 10th February 2019, 13:59
by mollymolluskus
Actually, I was just thinking about this yesterday: why not just have ONE command for ascending or descending stairs? Stairs in DCSS are never double, they always either lead up or down, so why differentiate the command? Just have < or > mean "climb up or down stairway/pit/escape hatch"
MM

Re: Add function to prevent accidental pressing both < and >

PostPosted: Monday, 11th February 2019, 16:30
by petercordia
VeryAngryFelid wrote:As a person who sometimes fat-fingers < and > I still think always using > to use stairs will lead to more problems, it is easier to "double press" > than fat-finger < and >.