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

Key modifiers are ignored (if they aren't valid) #238

Closed Drarok closed 4 years ago

Drarok commented 5 years ago

Phoenix binds to a key press, ignoring the modifiers I pass, meaning pressing the key on its own (such as when trying to type this message) triggers my callback.

I'm using the following code:

Key.on('p', ['command', 'control'], function () {
  Phoenix.notify('Hello there!');
});

Edit: This code also behaves the same as above, binding to just the p alone:

let keyHandler = new Key('p', ['command', 'control'], function () {
  Phoenix.notify('Hello there!');
});

I've worked it out at last, but there's nothing in Console.app to tell me what's going wrong, and the docs are unclear, stating:

Modifiers: command (cmd), option (alt), control (ctrl) and shift (case insensitive)

I read this to mean both command and cmd are valid, when it appears that only cmd is valid. I would expect invalid modifiers to throw an error, or for Phoenix to accept both command and cmd as modifiers.

kasper commented 5 years ago

@Drarok command, option and control are implemented in the unreleased 2.6.3 (master), which I really need to get out. 😄

kasper commented 4 years ago

Fixed in 2.6.3.