Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to specify inputs from two devices #1075

Open
gahisee opened this issue Mar 2, 2025 · 4 comments
Open

No way to specify inputs from two devices #1075

gahisee opened this issue Mar 2, 2025 · 4 comments

Comments

@gahisee
Copy link

gahisee commented Mar 2, 2025

For example,
I want to map (Ctrl key + Middle mouse button) to trigger
the output Ctrl+V.

I have not found a way if it's possible at all.

@gahisee
Copy link
Author

gahisee commented Mar 2, 2025

OK, after much experiments and a little help from CoPilot,
here's my macro in config.json:

"macros": {
    "keystroke_sleep_ms": 10,
    "ctrl_v_macro": {
        "on_key_down": "BTN_MIDDLE",
        "condition": "$Ctrl_L && !$triggered",
        "action": "set(triggered, 1).hold_keys(Ctrl_L+V)"
    },
    "reset_trigger_mouse": {
        "on_key_up": "BTN_MIDDLE",
        "action": "set(triggered, 0)"
    }
}

but when I press Ctrl key and the Middle mouse button,
there's a flurry of outputs. but no Ctrl+V which is I'm expecting!
Please advise as to what I'm doing wrong...

@penguinbait
Copy link

didn't really review this at all, but control-v is paste. Is the flurry of output whatever was in your clipboard?

@gahisee
Copy link
Author

gahisee commented Mar 4, 2025

Right, that's all i'm trying to do: when both ctrl key and middle mouse button are pushed, trigger the ctrl-v paste action.
input-remapper gui only allows for single device presets.

no, the flurry of outputs is not ctrl-v's. it's so fast it's hard to tell but it opens multiple browser windows, etc. etc.
if you can manage to find working macros to accomplish this, i'd love to see it. though i admit this is not critical but mainly, at this point, technical exercise...

@penguinbait
Copy link

penguinbait commented Mar 5, 2025

something like this

On Mouse - macro keyboard + mouse
if_eq($foo, 1, hold_keys(Control_R,v), hold_keys(BTN_MIDDLE))

On Keyboard - macro keyboard + mouse
set(foo, 1).hold_keys(space).set(foo, 0)

I press the button I get space, I press the mouse button, I get the mouse button, I press both I get control-V.

https://github.com/sezanzeb/input-remapper/blob/main/readme/examples.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants