Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMM-KeyBindings #14

Open
DennisFre opened this issue Nov 22, 2018 · 4 comments
Open

MMM-KeyBindings #14

DennisFre opened this issue Nov 22, 2018 · 4 comments

Comments

@DennisFre
Copy link

DennisFre commented Nov 22, 2018

Hey,
can't get the keybindings up and running with my Amazon remote.

If I habe a look into the chrome dev console it looks like this:

MMM-OnScreenMenu.js:430 Uncaught TypeError: Cannot use 'in' operator to search for 'ArrowUp' in undefined at Class.validateKeyPress (MMM-OnScreenMenu.js:430) at Class.notificationReceived (MMM-OnScreenMenu.js:105) at sendNotification (main.js:95) at Object.sendNotification (main.js:498) at Class.sendNotification (module.js:368) at Mousetrap.bindGlobal (MMM-KeyBindings.js:142) at f (mousetrap.min.js:5) at c.h._handleKey (mousetrap.min.js:7) at c.handleKey (mousetrap.min.js:10) at HTMLDocument.d (mousetrap.min.js:5)

Here is my config.js:
`
{
module: 'MMM-OnScreenMenu',
position: 'bottom_right',
// Valid positions: 'top_right', 'top_left', 'bottom_right', 'bottom_left'
config: {
touchMode: true,
enableKeyboard: true,
menuItems: {
monitorOff: { title: "Turn Off Monitor", icon: "television", source: "ALL" },
restart: { title: "Restart MagicMirror", icon: "recycle", source: "ALL" },
refresh: { title: "Refresh MagicMirror", icon: "refresh", source: "ALL" },
reboot: { title: "Reboot", icon: "spinner", source: "ALL" },
shutdown: { title: "Shutdown", icon: "power-off", source: "ALL" },
},
enableKeyBindings: true,
keyBindingsMode: "OSM",
keyBindings: {
Up: "ArrowUp",
Down: "ArrowDown",
Select: "Enter",
Close: "Return",
Menu: "Menu"
},
kbMultiInstance: true,
keyBindingsTakeFocus: "Menu"

        }
	}

`

Any suggestions ?

Cheers

@shbatm
Copy link
Owner

shbatm commented Nov 22, 2018

Try changing enableKeyboard: true, to enableKeyboard: false, if you have enableKeyBindings: true. They are mutually exclusive--if you have MMM-KeyBindings then all keyboard functions are handled by that module and 'enableKeyboard' in this module will get in the way.

Note to self: I need to clean up error handling & config options.

@DennisFre
Copy link
Author

DennisFre commented Nov 23, 2018 via email

@mafraqs
Copy link

mafraqs commented May 12, 2019

I'd like to jump in on this issue.
I've set up MMM-KeyBindings and MMM-OnScreenMenu. Below is my current config. While I'm able to control the OSM with a Keyboard (connected via USB to my raspi), I'm not able to control OSM with my connected Amazon Fire TV Remote. The keypress from the Amazon remote control is registered as seen in the log (see below config).
What is wrong, please help :)

config.js

{
    module: 'MMM-KeyBindings',
    config: {  
        enableKeyboard: true, 
    },
},
{
    module: 'MMM-OnScreenMenu',
    position: 'bottom_right',
    /* Valid positions: 'top_right', 'top_left', 'bottom_right', 'bottom_left' */
    config: {
        touchMode: true,
        menuItems: {
            monitorToggle: { title: "Toggle Monitor", icon: "television", source: "ALL" },
            openDevTools: { title: "Open Dev Tools", icon: "laptop-code", source: "ALL" },
            restart: { title: "Restart MagicMirror", icon: "recycle", source: "ALL" },
            refresh: { title: "Refresh MagicMirror", icon: "refresh", source: "ALL" },
            reboot: { title: "Reboot", icon: "spinner", source: "ALL" },
            shutdown: { title: "Shutdown", icon: "power-off", source: "ALL" },
        },
        enableKeyBindings: true,
        keyBindingsMode: "OSM",
        keyBindings: {
            Up: "ArrowUp",
            Down: "ArrowDown",
            Select: "Enter",
            Close: "Return",
            Menu: "Menu"
        },
        keyBindingsTakeFocus: "Menu"
    },
},

dev console log

clock received a module notification: KEYPRESS from sender: MMM-KeyBindings
module.js:154 calendar received a module notification: KEYPRESS from sender: MMM-KeyBindings
newsfeed.js:344 newsfeed - received notification: KEYPRESS
newsfeed.js:403 newsfeed - unknown notification, ignoring: KEYPRESS
module.js:154 clock received a module notification: KEYPRESS from sender: MMM-KeyBindings
module.js:154 calendar received a module notification: KEYPRESS from sender: MMM-KeyBindings
newsfeed.js:344 newsfeed - received notification: KEYPRESS
newsfeed.js:403 newsfeed - unknown notification, ignoring: KEYPRESS
module.js:154 clock received a module notification: KEYPRESS from sender: MMM-KeyBindings
module.js:154 calendar received a module notification: KEYPRESS from sender: MMM-KeyBindings
newsfeed.js:344 newsfeed - received notification: KEYPRESS
newsfeed.js:403 newsfeed - unknown notification, ignoring: KEYPRESS

@matze6486
Copy link

I'd like to jump in on this issue.
I've set up MMM-KeyBindings and MMM-OnScreenMenu. Below is my current config. While I'm able to control the OSM with a Keyboard (connected via USB to my raspi), I'm not able to control OSM with my connected Amazon Fire TV Remote. The keypress from the Amazon remote control is registered as seen in the log (see below config).
What is wrong, please help :)

config.js

{
    module: 'MMM-KeyBindings',
    config: {  
        enableKeyboard: true, 
    },
},
{
    module: 'MMM-OnScreenMenu',
    position: 'bottom_right',
    /* Valid positions: 'top_right', 'top_left', 'bottom_right', 'bottom_left' */
    config: {
        touchMode: true,
        menuItems: {
            monitorToggle: { title: "Toggle Monitor", icon: "television", source: "ALL" },
            openDevTools: { title: "Open Dev Tools", icon: "laptop-code", source: "ALL" },
            restart: { title: "Restart MagicMirror", icon: "recycle", source: "ALL" },
            refresh: { title: "Refresh MagicMirror", icon: "refresh", source: "ALL" },
            reboot: { title: "Reboot", icon: "spinner", source: "ALL" },
            shutdown: { title: "Shutdown", icon: "power-off", source: "ALL" },
        },
        enableKeyBindings: true,
        keyBindingsMode: "OSM",
        keyBindings: {
            Up: "ArrowUp",
            Down: "ArrowDown",
            Select: "Enter",
            Close: "Return",
            Menu: "Menu"
        },
        keyBindingsTakeFocus: "Menu"
    },
},

dev console log

clock received a module notification: KEYPRESS from sender: MMM-KeyBindings
module.js:154 calendar received a module notification: KEYPRESS from sender: MMM-KeyBindings
newsfeed.js:344 newsfeed - received notification: KEYPRESS
newsfeed.js:403 newsfeed - unknown notification, ignoring: KEYPRESS
module.js:154 clock received a module notification: KEYPRESS from sender: MMM-KeyBindings
module.js:154 calendar received a module notification: KEYPRESS from sender: MMM-KeyBindings
newsfeed.js:344 newsfeed - received notification: KEYPRESS
newsfeed.js:403 newsfeed - unknown notification, ignoring: KEYPRESS
module.js:154 clock received a module notification: KEYPRESS from sender: MMM-KeyBindings
module.js:154 calendar received a module notification: KEYPRESS from sender: MMM-KeyBindings
newsfeed.js:344 newsfeed - received notification: KEYPRESS
newsfeed.js:403 newsfeed - unknown notification, ignoring: KEYPRESS

Do you found a solution for this issue? i have exactly the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants