Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0006455Dwarf FortressTechnical -- Input/Keybinding/Macrospublic2014-03-12 13:552014-12-07 15:37
normalminorhave not tried
resolvedno change required 
0006455: Modifier keys are not cleared when using alt-tab to switch from DF to another application (on Windows)
There are numerous reports regarding this behavior (see http://www.reddit.com/r/dwarffortress/comments/1zxmxt/hit_m_to_open_military_screen_but_goes_to_dwarf/, [^] http://www.bay12forums.com/smf/index.php?topic=135487, [^] etc.), but I was unable to find any on the bug tracker. I initially assumed this was a bug in SDL, like 0006374, but I recently found a solution from another project using SDL that had this problem: https://github.com/sirikata/sirikata/commit/231fb1c8a723316d9b6c1ec6599a94269baa0324 [^] (it could take a bit of work to adapt to DF, but the main idea is that it clears the active modifier keys when the window's focus changes).
Set a keybinding to use Alt (e.g. changing announcements to Alt-U), Alt-tab out of DF, switch back to DF, and press "u". The units menu should be displayed, but the announcements screen is displayed instead.
I don't actually have a Windows machine to test on, so I'm going by what others have reported. I have not tested on Linux yet, so I'm unaware if this occurs on any platforms other than Windows (definitely not on OS X, since it uses Command-tab instead and the Command key isn't recognized by DF as a modifier)
No tags attached.
Issue History
2014-03-12 13:55lethosorNew Issue
2014-09-10 15:32nuget102Note Added: 0030093
2014-09-10 18:14lethosorSummaryModifier keys are not cleared when using alt-tab to switch from DF to another application (Windows) => Modifier keys are not cleared when using alt-tab to switch from DF to another application (on Windows)
2014-11-25 16:23lethosorNote Added: 0031185
2014-11-25 16:23lethosorAssigned To => lethosor
2014-11-25 16:23lethosorStatusnew => needs feedback
2014-11-25 16:23lethosorNote Edited: 0031185bug_revision_view_page.php?bugnote_id=0031185#r12420
2014-12-07 15:37lethosorNote Added: 0031290
2014-12-07 15:37lethosorStatusneeds feedback => assigned
2014-12-07 15:37lethosorStatusassigned => resolved
2014-12-07 15:37lethosorResolutionopen => no change required

2014-09-10 15:32   
I can confirm this bug, and I can also confirm it's relatively annoying. But it's not too big of a deal, just simply tap 'alt' after you go back to the game and you won't have any problems.
2014-11-25 16:23   
Discussions in various threads imply that this is a utility-related problem. Has anyone been able to reproduce this without any utilities?

2014-12-07 15:37   
According to discussion at http://www.bay12forums.com/smf/index.php?topic=139553.msg5860257#msg5860257, [^] this is a DFHack problem.