JetBrains / intellij-streamdeck-plugin

An IntelliJ IDE plugin and the paired Stream Deck JS plugin to support developing with pleasure using Stream Deck
https://plugins.jetbrains.com/plugin/22441-stream-deck
Apache License 2.0
46 stars 8 forks source link

Stream Deck Buttons do nothing when Rider has Focus #21

Open klafekie opened 5 months ago

klafekie commented 5 months ago

I have trouble with my new stream deck when using it together with Rider. I am a visually impaired software developer and need the stream deck to automate some tasks that are otherwise pretty teadious for me.

Whenever Rider has focus all my stream deck buttons stop working!

For testing I am having some very simple buttons configured:

None of these works when Rider has the focus. But

still works normally.

I have installed only the Windows Actions plugin, nothing else: https://github.com/aasmal97/Window-Actions

So in particular I don't have the jetbrains plugin installed, but I just hope you can help me anyway cause I believe you are most familiar with the topic.

Thanks a lot in advance :)

I have this Rider version:

JetBrains Rider 2023.3.5 Build #RD-233.15026.31, built on April 21, 2024 Runtime version: 17.0.10+1-b1087.23 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 .NET (backend unavailable) GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 28 Registry: editor.config.csharp.support=true ide.experimental.ui=true

beansoft commented 5 months ago

Hi @klafekie , thanks for submitting the issue. I've dig a little for the plugin's source code, eg: https://github.com/aasmal97/Window-Actions/blob/master/Sources/com.arkyasmal.windowActions.sdPlugin/app/windowsScripts/virtualDesktopActions.py

    keyboard = Controller()
    keyboard.press(Key.cmd)
    keyboard.press(Key.ctrl)
    keyboard.press("d")
    keyboard.release("d")
    keyboard.release(Key.ctrl)
    keyboard.release(Key.cmd)

The plugin seems to try to simulate the keys: cmd(Win) + Ctrl + D to trigger the action, it may be conflict with the Rider's default keymap, you can check it via the menu File | Settings | Keymap, but I'm not sure if it's the reason.

For Windows actions, it's a bit complex, eg minimize a window:

def minimize_window(win_id_type, win_id):
    matching_windows = get_matching_windows_list(win_id_type, win_id)
    result = [ShowWindow(i['hWnd'], win32con.SW_MINIMIZE) for i in matching_windows]
    return result

It sounds like it tries to use some Win32 APIs to manipulate the window. However, by default the Rider IDE will not show the native Windows title bar, you may try to bring it back first via the menu Help | Edit Custom Properties Enter: ide.win.frame.decoration=false and then restart the IDE, the native Windows button will be displayed, then it should work with Windows minimize actions.

Please try and tell me the result. I've not tried these settings yet as it's a bit late today.

In the meantime, you may also ask for help from the Rider team directly via the Rider menu Help | Contact Support, there should be chances that the Rider developers could give some advice. I'm mostly focusing on Java plugins.

klafekie commented 4 months ago

Thanks a lot for your quick reply! I tried your proposal with ide.win.frame.decoration=false But no success here unfortunately. Regarding conflicts with the keymap: this seems unlikely, because when I try to use the Find Actions by Shortcu function as suggested here https://www.jetbrains.com/help/rider/Keyboard_Shortcuts_Troubleshooting.html#does-the-keystroke-reach-the-ide

Nothing happens when I press my streamdeck buttons with shortcuts like Win+left or Win+right to switch between virtual desktops. When I hit the corresponding shortcuts on the keyboard it works as expected.

But I found something interesting: The problem occurs only with Rider. With WebStorm there is no such problem! I am using this version of WebStorm:

WebStorm 2023.3.4 Build #WS-233.14475.40, built on February 14, 2024 Runtime version: 17.0.10+1-b1087.17 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 28 Registry: ide.experimental.ui=true Non-Bundled Plugins: dev.nx.console (1.21.0)