Rewired - Advanced Input for Unity

Hi, I’ve looked at the docs thoroughly, but can’t find anything to address my issue.

In my Windows Standalone build, when pressing ALT+ENTER, the window toggles fullsreen as intended, but an ENTER event is still fired in my UI, causing the player to press on the selected menu button each time they press ALT+ENTER.

I’m on v1.1.57.2
Unity 2022.3

I have my Return key set with no modifiers.

EDIT : Just updated to 1.1.58.1 and no difference.

There is no such concept as “primary” and “alternate” bindings in Rewired. Rewired supports an unlimited number bindings to any Action from any number of controllers.

Control Mapper doesn’t display a primary and an alternate. It simply displays the first and second (or as many columns as you choose) bindings found for that Action for the controller in question. The order in which they are displayed comes from iterating the Action Element Maps in the Controller Map and displaying them in order in which they appear. Rebinding an existing binding will usually result in the older bindings shifting left and the newest binding appearing in the last column. Control Mapper is also not using the Unity UI Player Controller Element Glyph class to display glyphs. It uses the Unity UI Controller Element Glyph class, which displays a glyph for a specific known Action Element Map as opposed to searching for bindings on the last active controller and/or controller type prioritization, fallbacks, etc., and displaying the first applicable glyph for the Action found in the Player.

The Unity UI Player Controller Element Glyph class only displays the first glyph found (or glyphs in the case of split bindings or an Axis-type Action and/or keyboard bindings with modifiers). There’s no way to do this without making your own implementations of UnityUIPlayerControllerElementGlyphBase and sub classes and changing everything to search for bindings by index or something similar. (It won’t be a quick or easy change.)

1 Like

This is due to the use of Raw Input for keyboard handling. Rewired Input Manager → Settings → Windows → Native Keyboard Handling.

Raw Input sends all keyboard events to the application. The Enter key down event is not suppressed by Windows when the application has focus and Alt + Enter is pressed to change the screen mode. I don’t know if there is any way to determine this directly from the Raw Input data without also having access to all the other relevant Windows events. I doubt it.

The only “solutions” are to either disable Native Keyboard Handling or implement an input processing pause for some time period after full screen mode is enabled/disabled. (The second option wouldn’t handle all the other possible system hot keys such as Alt + Tab, etc.) Likely, the only reason disabling Native Keyboard Handling works is that the underlying UnityEngine.Input keyboard handling uses a different input API (WM_KEYUP/WM_KEYDOWN). Based on my testing, this results in no key down event for the Enter key in this scenario initially, but it will send the down event if held longer than about 1 second. It is unclear to me whether this delay is implemented by Windows or Unity, but I suspect Windows is doing it.