WebDeck icon indicating copy to clipboard operation
WebDeck copied to clipboard

Keyboard shortcuts functionality (hotkeys)

Open kewitt opened this issue 1 year ago • 5 comments

Is there a way to add modifier keys? Controll + ALT + Shift + X

kewitt avatar Jun 30 '24 00:06 kewitt

Not yet, but it will be added very soon thanks to PyMacroRecord

Lenochxd avatar Jun 30 '24 00:06 Lenochxd

Nothing that complicated is needed! It's just a way to note and send modifier keys. Could you send multiple keys at once?

https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes ie Ctrl ( ^ ), Alt ( ! ), Shift ( + ) and Win ( # )

But it does look like PymacroRecord Will add everything plus more I can wait.

kewitt avatar Jun 30 '24 01:06 kewitt

Nothing that complicated is needed! It's just a way to note and send modifier keys. Could you send multiple keys at once?

https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes ie Ctrl ( ^ ), Alt ( ! ), Shift ( + ) and Win ( # )

But it does look like PymacroRecord Will add everything plus more I can wait.

I would be also interacted in similar (EASY) sequence typing, it would be so useful for gaming, one think i want is to create helldivers2 macros for calling stratogems. dont het me wrong PymacroRecord is super cool and i use it a lot but less complicated just 2-6 keys macro are i think overkill in PymacroRecord

GamerClassN7 avatar Jul 05 '24 16:07 GamerClassN7

Any news on this ?

GamerClassN7 avatar Aug 16 '24 14:08 GamerClassN7

I resolved it by creating a Python script, which is launched through a batch file, and that batch file is in turn triggered by WebDeck.

I used it to launch the Nvidia Save Replay hotkeys (Alt+F10)

Python file

import time

def send_alt__f10():
    """
    Sends the ALT+SHIFT+F10 hotkey combination to the system.
    """
    try:
        # Press down ALT, SHIFT, and F10
        pyautogui.keyDown('alt')
        pyautogui.keyDown('f10')

        # You might need a small delay here depending on the application
        # that needs to receive the hotkey.
        time.sleep(0.1)

        # Release F10, then SHIFT, then ALT (important to release in reverse order)
        pyautogui.keyUp('f10')
        pyautogui.keyUp('alt')

        print("ALT+F10 hotkey sent successfully.")
    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    # It's often good practice to add a small delay before sending
    # hotkeys to give you time to switch to the target application
    # or ensure the script doesn't interfere immediately upon execution.
    print("Script will send ALT+F10 in 3 seconds. Switch to your target application.")
    send_alt__f10()

Batch script

@echo off
cd /d "E:\Clouding\Dropbox\INFORMATICA\GitHub\Send Hotkeys"

echo Activating virtual environment...
call "venv\Scripts\activate.bat"

if errorlevel 1 (
    echo Failed to activate virtual environment.
    pause
    exit /b
)

echo Running the Python script...
python "Save Nvidia Replay Buffer.py"

if errorlevel 1 (
    echo Failed to run the script. Check for errors.
    pause
)

echo Done.
pause

trunksn1 avatar Jun 28 '25 05:06 trunksn1