skyrim-community-shaders
skyrim-community-shaders copied to clipboard
Screenshot key toggles shaders on/off when EffectToggleKey is unbound (0).
trafficstars
Disclaimer: I am not familiar with the source code, nor did I spend all that much time reading through the (suspected) problem area.
Problem:
When EffectToggleKey is 0 (unbound) the default Skyrim screenshot key toggles shaders on/off every time a screenshot is taken.
What I think is happening:
- Menu.cpp:1418 returns event.keyCode for PrintScreen key because VK_PRINT hasn't been implemented in Menu.cpp:1333.
- Fallback function at Menu.cpp:1421 most likely returns 0.
- Menu.cpp:1437 does not check for settings.EffectToggleKey being equal to 0 (unbound).
- Thus the PrintScreen key (default Skyrim screenshot key) toggles shaders on/off. The check at Menu.cpp:1437 evaluates to:
} else if (0 == 0) {
Potential fixes:
- Implement missing VK keys in DIKToVK and get rid of MapVirtualKeyEx.
- Change the input parameters to MapVirtualKeyEx, or figure out why the scancode for PrintScreen is not getting translated to a VK.
- Check for unbound keys i.e. never compare pressed key to 0; or redefine what an unbound key means: -1 for instance.
Environment:
Community Shaders 1.1.15 Corsair K100 RGB Scandinavian, QWERTY Windows 11 Pro 23H2