debauchee / barrier

Open-source KVM software
Other
27.33k stars 1.51k forks source link

Switch command and windows key depending on which barrier is controling #811

Open nameajeff opened 4 years ago

nameajeff commented 4 years ago

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

shymega commented 4 years ago

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.

nameajeff commented 4 years ago

@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 .

--

raleighr3 commented 4 years ago

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.

sa1 commented 4 years ago

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

nameajeff commented 4 years ago

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 .

--