mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #538] Issues trying to use AutoHotKey to trigger Barrier #418
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#418
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @da3dsoul on GitHub (Jan 5, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/538
Operating Systems
Server: Windows 10 1909
Client: Linux Kernel 5.4 (a fucked up frankenstein that started as a buntu)
Barrier Version
2.3.2
Steps to reproduce bug
So I'm trying to put Barrier in an automated process. I have a Windows desktop and a linux server both connected to single LG TV. I made a script that changes my TV input, and Barrier handles the mouse and keyboard. I am using AutoHotKey, because I can't figure out a better way to do this.
I set the hotkey to switch to the server to a bunch of modifiers + F12, to switch back, the same + F11 in barrier.
In AutoHotKey, I have it listen for a different set of modifiers and the same F keys.
AutoHotKey captures the keys, switches my TV input, and then fires the keys for barrier to switch.
The Issue
When AutoHotKey fires the keys, barrier takes them, moves the focus, then AutoHotKey can't release them properly (I think....). I've tried every which way I can think of to fire the keys with AutoHotKey.
Log: https://gist.github.com/da3dsoul/d76d948ac8638e500691b0d3349d51fc
Other info
@da3dsoul commented on GitHub (Jan 5, 2020):
Okay, I managed to work around this a bit by making AutoHotKey wait until all modifier keys are up to trigger the barrier hotkey, and I set barrier's hotkeys to key that I don't have (F13 and F14) without modifiers. It stopped holding down the modifier keys, but I'm still working on getting it to switch back now, as barrier consumes the keypresses, preventing a switch back. It worked before, as the hotkeys coincidentally overlapped, and that caused both to be triggered at once before. Luckily Ctrl+Alt+Delete works to force focus back to the server (windows).
@sorin25 commented on GitHub (Jan 8, 2020):
You might try to switch the roles and use the linux as a server and use the --screen-change-script option to switch the inputs of the TV.
Any luck with authotkey ? (I'm trying to do a similar thing, but I'm forced to use the windows machine as server)
@da3dsoul commented on GitHub (Jan 8, 2020):
Kind of. I got a working setup, but sometimes I need to send the commands multiple times, as barrier needs to switch before autohotkey is fired
@sorin25 commented on GitHub (Jan 8, 2020):
Can you share your autohotkey script ? I can manage switching the input of the monitor, but can't seem to figure out how to send keys to barrier.
@da3dsoul commented on GitHub (Jan 9, 2020):
Basically, I don't send keys to barrier. I'll up it in a few.
@csm10495 commented on GitHub (May 13, 2020):
Hey @da3dsoul did you ever have issues where AHK macros wouldn't work if in the other computer's screen? I'm having that right now
@da3dsoul commented on GitHub (May 13, 2020):
Yeah scroll up a bit. Basically, you send the command to switch as part of the command
@da3dsoul commented on GitHub (May 13, 2020):
I've been trying to get a better implementation of this, but I got a weird issue where barrier just wouldn't take keyboard input at all. I don't know why
@csm10495 commented on GitHub (May 13, 2020):
I'm not sure that makes sense. If i make a macro that does a msgbox when i hit the 1 key, the msgbox won't come up if my mouse is in on the other barrier system.
@da3dsoul commented on GitHub (May 13, 2020):
My specific system is designed to execute a command on switch (such as switching inputs on the TV)
@da3dsoul commented on GitHub (May 16, 2020):
Okay, I got something that works with only one keypress.
Barrier
AutoHotkey
You may need to add F13 and F14 (in this example) to the ImmuneKeys.txt, but I didn't need to.
I remapped my Scroll Lock and Pause buttons to F13 and F14.
@rodrigo-o commented on GitHub (Jul 3, 2020):
I did something similar to what you use but with no effect. In my case, the keystroke is correctly pressed on the server working as expected but I have the same AHK in the client when going back to the server display input and the keystroke didn't work. Could it be something related to barrier capturing keystrokes only from the server or the physical keyboard, and not simulated ones in the client?
@da3dsoul commented on GitHub (Jul 3, 2020):
In my setup, I did not have AHK on the client (since it's not Windows, mostly)