[GH-ISSUE #811] Switch command and windows key depending on which barrier is controling #640

Open
opened 2026-05-05 06:49:43 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @nameajeff on GitHub (Jul 22, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/811

I have installed Barrier on my windows and mac computers, got it up and running no problem, using my mac as the primary host computer, with the windows desktop as the client. I have set my keyboard up to switch the windows key and alt/option key, to match what is default for mac keyboards, this is working fine, however now these keys are switched over on my windows desktop when using barrier. Is there a way to switch this back for the windows machine? I know there was a way to switch this on the sharemouse software, however i can't find any way to do this here.
Thanks

Originally created by @nameajeff on GitHub (Jul 22, 2020). Original GitHub issue: https://github.com/debauchee/barrier/issues/811 I have installed Barrier on my windows and mac computers, got it up and running no problem, using my mac as the primary host computer, with the windows desktop as the client. I have set my keyboard up to switch the windows key and alt/option key, to match what is default for mac keyboards, this is working fine, however now these keys are switched over on my windows desktop when using barrier. Is there a way to switch this back for the windows machine? I know there was a way to switch this on the sharemouse software, however i can't find any way to do this here. Thanks
Author
Owner

@shymega commented on GitHub (Jul 28, 2020):

I'm not aware of any functionality in Barrier right now to do so. I've never used a Mac, but it sounds like an important issue to fix.. cc/ @p12tic for further investigtion.

<!-- gh-comment-id:665274815 --> @shymega commented on GitHub (Jul 28, 2020): I'm not aware of any functionality in Barrier right now to do so. I've never used a Mac, but it sounds like an important issue to fix.. cc/ @p12tic for further investigtion.
Author
Owner

@nameajeff commented on GitHub (Aug 2, 2020):

@p12tic https://github.com/p12tic
Please help! Would be awesome if this one issue could be addressed,
everything else works perfectly for me

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, 29 Jul 2020 at 04:48, Dom Rodriguez notifications@github.com
wrote:

I'm not aware of any functionality in Barrier right now to do so. I've
never used a Mac, but it sounds like an important issue to fix.. cc/
@p12tic https://github.com/p12tic for further investigtion.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/debauchee/barrier/issues/811#issuecomment-665274815,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQL2IPFVZ3RY6TX5N6TO6MDR542SDANCNFSM4PE5EZKQ
.

--

<!-- gh-comment-id:667703366 --> @nameajeff commented on GitHub (Aug 2, 2020): @p12tic <https://github.com/p12tic> Please help! Would be awesome if this one issue could be addressed, everything else works perfectly for me <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, 29 Jul 2020 at 04:48, Dom Rodriguez <notifications@github.com> wrote: > I'm not aware of any functionality in Barrier right now to do so. I've > never used a Mac, but it sounds like an important issue to fix.. cc/ > @p12tic <https://github.com/p12tic> for further investigtion. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/debauchee/barrier/issues/811#issuecomment-665274815>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AQL2IPFVZ3RY6TX5N6TO6MDR542SDANCNFSM4PE5EZKQ> > . > --
Author
Owner

@raleighr3 commented on GitHub (Aug 12, 2020):

I am having this same issue.
Mac my primary machine and is set up as the Barrier server. Windows 10 machine is the client. On windows I've used SharpKeys to remap the alt and windows keys (swap them) as I am using a Mac keyboard layout. However, the remapping doesn't seem to work when using Barrier.

<!-- gh-comment-id:672850361 --> @raleighr3 commented on GitHub (Aug 12, 2020): I am having this same issue. Mac my primary machine and is set up as the Barrier server. Windows 10 machine is the client. On windows I've used SharpKeys to remap the alt and windows keys (swap them) as I am using a Mac keyboard layout. However, the remapping doesn't seem to work when using Barrier.
Author
Owner

@sa1 commented on GitHub (Aug 12, 2020):

It would be helpful if Barrier could do it but temporarily you can do it by detecting mouse movements yourself. I am currently doing it this way:

const robot = require("robotjs");

var xDirection = "";
var yDirection = "";
 
var oldX = 0;
var oldY = 0;

(async function() {
    const device = uhk.getUhkDevice()
    while(true) {
        var mouse = robot.getMousePos()
        var direction = 
        getMouseDirection(mouse)
        if (mouse.x < 20 && xDirection === "left") {
            const sendData = await uhk.switchKeymap(device, "QWM")
        } else if (mouse.x < 100 && xDirection === "right") {
            const sendData = await uhk.switchKeymap(device, "QWR")
        }
        await new Promise(resolve => setTimeout(resolve, 1));
    }
})()

function getMouseDirection(mouse) {
  if (oldX < mouse.x) {
    xDirection = "right";
  } else {
    xDirection = "left";
  }
  if (oldY < mouse.y) {
    yDirection = "down";
  } else {
    yDirection = "up";
  }
  oldX = mouse.x;
  oldY = mouse.y;
 }

Very hacky, and I switch the keybindings for my UHK device, You can also use autohotkey etc

<!-- gh-comment-id:673034732 --> @sa1 commented on GitHub (Aug 12, 2020): It would be helpful if Barrier could do it but temporarily you can do it by detecting mouse movements yourself. I am currently doing it this way: ```const uhk = require('./uhk'); const robot = require("robotjs"); var xDirection = ""; var yDirection = ""; var oldX = 0; var oldY = 0; (async function() { const device = uhk.getUhkDevice() while(true) { var mouse = robot.getMousePos() var direction = getMouseDirection(mouse) if (mouse.x < 20 && xDirection === "left") { const sendData = await uhk.switchKeymap(device, "QWM") } else if (mouse.x < 100 && xDirection === "right") { const sendData = await uhk.switchKeymap(device, "QWR") } await new Promise(resolve => setTimeout(resolve, 1)); } })() function getMouseDirection(mouse) { if (oldX < mouse.x) { xDirection = "right"; } else { xDirection = "left"; } if (oldY < mouse.y) { yDirection = "down"; } else { yDirection = "up"; } oldX = mouse.x; oldY = mouse.y; } ``` Very hacky, and I switch the keybindings for my UHK device, You can also use autohotkey etc
Author
Owner

@nameajeff commented on GitHub (Aug 12, 2020):

I figured out how to fix it. If you go onto configuration and double click
on the Mac computer icon on the map, you were able to change the modifier
keys such as command alt option etc

On Wed, 12 Aug 2020 at 20:49, raleighr3 notifications@github.com wrote:

I am having this same issue.
Mac my primary machine and is set up as the Barrier server. Windows 10
machine is the client. On windows I've used SharpKeys to remap the alt and
windows keys (swap them) as I am using a Mac keyboard layout. However, the
remapping doesn't seem to work when using Barrier.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/debauchee/barrier/issues/811#issuecomment-672850361,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQL2IPHUFT7L4RTQU4YWBFDSAKFWJANCNFSM4PE5EZKQ
.

--

<!-- gh-comment-id:673091335 --> @nameajeff commented on GitHub (Aug 12, 2020): I figured out how to fix it. If you go onto configuration and double click on the Mac computer icon on the map, you were able to change the modifier keys such as command alt option etc On Wed, 12 Aug 2020 at 20:49, raleighr3 <notifications@github.com> wrote: > I am having this same issue. > Mac my primary machine and is set up as the Barrier server. Windows 10 > machine is the client. On windows I've used SharpKeys to remap the alt and > windows keys (swap them) as I am using a Mac keyboard layout. However, the > remapping doesn't seem to work when using Barrier. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/debauchee/barrier/issues/811#issuecomment-672850361>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AQL2IPHUFT7L4RTQU4YWBFDSAKFWJANCNFSM4PE5EZKQ> > . > --
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#640
No description provided.