Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Mouse blocks keyboard menu interaction

Open failboat78 opened this issue 1 year ago • 7 comments

Describe the bug

Refers to playing with default keyboard controls on pc.

Open action menu by pressing enter. Press up/down and observe what happens.

Attach save file

N/A trivial

Steps to reproduce

Press enter, then press up/down.

Expected behavior

Pressing up/down should move the highlighted selection in the list up/down.

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version:
  • Game Version: cdda-experimental-2024-08-25-0446 5237214 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], Mythical Martial Arts [MMA], Bombastic Perks [bombastic_perks], Mind Over Matter [mindovermatter] ]

Additional context

No response

failboat78 avatar Aug 25 '24 09:08 failboat78

Failed to reproduce.

The up/down arrow keys move the cursor.

PatrikLundell avatar Aug 25 '24 10:08 PatrikLundell

Hmm yeah - it must be in some specific circumstance only. I'll post back with more details.

failboat78 avatar Aug 25 '24 10:08 failboat78

Please post your options.json here

ZhilkinSerg avatar Aug 25 '24 10:08 ZhilkinSerg

My option are just default.

Somehow I got the bug to come back - it affects all menus not just action menu. Symptom is cant move up/down.

image

Not sure how it gets into this state - still testing. After alt-tabbing and back it fixes itself. Notice how it seems 2 items are selected at same time.

failboat78 avatar Aug 25 '24 15:08 failboat78

https://github.com/user-attachments/assets/01efda93-eb46-47b0-b864-41e45d854751

Seems that the inputs of mouse have a higher priority in the ImGui. When the cursor of mouse is on the selection, the inputs of arrow keys will be disrupted.

osuphobia avatar Aug 25 '24 15:08 osuphobia

You are right - it's caused by the mouse. But in a really non-obvious way!

If you accidentally move the mouse into a certain part of hte screen, the pointer will always screw up the dialogs.

Suggested fix: if player press a key it should override any previous mouse ui interaction.

failboat78 avatar Aug 25 '24 15:08 failboat78

This is a side effect of something we're doing wrong in how we use ImGui. I haven’t quite narrowed it down, but it is either due to the fact that we don’t run ImGui at a constant frame rate (instead we wait for input and only update when we get it), or in how we handle mouse input.

As a result I had to write the code to check the mouse position myself, and I deliberately went with an unsophisticated implementation. In addition to this quirk (which I knew about but didn’t expect anyone to think of as a bug), it causes a more severe (and unexpected) problem on long scrolling menus like the item spawn menu. Fixing those problems is easy, but then hovering works correctly while clicking on menu items does nothing. I’ve been working on the underlying problem instead.

db48x avatar Aug 26 '24 02:08 db48x

I am Legend-trimmed.tar.gz

Issue is present again in latest version. Debug Map editor unusable due to maybe mouse input? But mouse is still. Menu selection jumps around uncontrollably.

  • OS: Windows
    • OS Version: 10.0.19045.4894 (22H2)
  • Game Version: abbb6ce [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], No Hope [no_hope], SpeedyDex [speedydex], Stats Through Kills [stats_through_kills], Stats Through Skills [StatsThroughSkills], Tamable Wildlife [Tamable_Wildlife], No Monsters [Only_Wildlife], Massachusetts [MA], <color_light_blue>Lighter Weariness [light_weariness], Railroads [railroads], Generic Guns [generic_guns] ]

RobertBoettcherSF avatar Sep 18 '24 20:09 RobertBoettcherSF

Are you referring to an issue like #76215?

CoroNaut avatar Sep 19 '24 00:09 CoroNaut