kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

How to remap keyboard #256

Closed fqr1 closed 4 years ago

fqr1 commented 4 years ago

Hello

I'm trying to remap the keyboard, from awsd to arrows, something like "Gaming mode"

~/.phoenix.js

var setupHandlers = function() {
    return {
        keyup: new Key('w', ['ctrl'], function() {
            Phoenix.log("Key Up")
            //TODO send event to press up 
        }),
        keydown: new Key('s', ['ctrl'], function() {
            Phoenix.log("Key Down")
            //TODO send event to press down
        }),
        keyleft: new Key('a', ['ctrl'], function() {
            Phoenix.log("Key Left")
            //TODO send event to press left
        }),
        keyright: new Key('d', ['ctrl'], function() {
            Phoenix.log("Key Right")
            //TODO send event to press right
        }),
    };
}

var keyHandlers = setupHandlers();

But I don't know how to send the key events for the arrows

Could you give me some examples?

kasper commented 4 years ago

@fqr1 Hi! Phoenix does not support remapping keys. You can for example use Karabiner for that.

fqr1 commented 4 years ago

Thanks! I'll look at that