Skip to content

Use Gamepad with MagicMirror

Notifications You must be signed in to change notification settings

victor-paumier/MMM-GamepadEvents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

MMM-GamepadEvents

Gamepad API for MagicMirror²

Features

  • Send notification based on button or axis pressed
  • Exec command based on button or axis pressed
  • Support of buttons combinations

Install

cd modules
git clone https://github.com/victor-paumier/MMM-GamepadEvents

Using the module

Edit your config/config.js file and add a new object to the modules:

{
  module: "MMM-GamepadEvents",
  config: {
    showNotif : true,
    showNotifPressed: false,
    scanFrequency: 150,
    combinations: []
  }
}

Configuration options:

Option Description
showNotif Show a notification on event sent or command executed.

Default value: true
showNotifPressed Show a notification on button pressed. Useful to get button id or axis.

Default value: false
scanFrequency Frequency of the scan of inputs.

Default value: 150
combinations Array of combinations with their event or command.
(see Combination options)

Default value: []

Combination options:

Option Description
gamepad Array of buttons and/or axis parameters.
(see Gamepad options)

Required
command The command to exec on combination pressed

Optional
event The event to send on combination pressed

Optional
param The param of the event

Optional
repeatEvent Send event only one time or repeat it each time the input is scanned

Default value: false

Gamepad options:

You can either define a button or more, a single axis with its axisValue, or both button(s) and axis.

Important: this module has only been developed in the way to allow a single axis to be triggered in a single direction at a time

Option Description
buttons Array of button ids.

Optional

Default value: []
axis The horizontal or vertical axis.

Optional

Possible values: X or Y
axisValue The corresponding value of axis to decide between left/right or up/down

Optional

Possible values: -1 or 1

Note

As the combinations are executed in the same order they are defined, and can only be call one time per scan (see scanFrequency parameter), it is recommend to defined combinations with multiple buttons (or buttons with axis) before combination with single gamepad actions

ToDo

  • Short/Long press
  • Specific showNotif per combination (& showNotifPressed?) options

About

Use Gamepad with MagicMirror

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published