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 · 8 comments
Open

No way to specify inputs from two devices #1075

gahisee opened this issue Mar 2, 2025 · 8 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

@sezanzeb
Copy link
Owner

sezanzeb commented Mar 6, 2025

"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)"
    }
}

I have never seen this sort of configuration schema. Not the first time that AI tools suggest configurations for input-remapper that don't work.

Remapping from multiple inputs can be implemented. Some work has already been done here: #1068

Other than that, check https://github.com/sezanzeb/input-remapper/blob/main/readme/examples.md#combinations-spanning-multiple-devices out

@gahisee
Copy link
Author

gahisee commented Mar 7, 2025

thanks for your comments. i learned that in practice, it's not so easy to combine key and mouse to create unique triggers. i accomplished what i wanted by using keyboard and trackball separately.

@sezanzeb
Copy link
Owner

sezanzeb commented Mar 7, 2025

i learned that in practice, it's not so easy to combine key and mouse to create unique triggers

Yeah, I agree. I hope that I'll find the time to continue #1068 eventually, but the next 1-2 months I'm probably going to be quite busy with other stuff. If this is finished, there will be a button to just apply a preset onto all devices at once. And you will be able to make combinations across arbitrary devices.

In fact, this already works. If you install from the custom_gruops branch there is already a suboptimal solution for the ui.

@sezanzeb
Copy link
Owner

sezanzeb commented Mar 7, 2025

(And your feedback might actually be quite valuable. If you find some time to install it and encounter a bug, just leave some comments on that PR, I'll look at them)

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

3 participants