Remote Controller Implementation

If you are building your own handlebar remote controller or if you are a manufacturer seeking support to make your handlebar controller work with DMD2 you can start by reading this page.

DMD2 requires the controller to send HID key down event when the button is pressed and key up event when the key is released. This allows DMD2 to internally handle things like:
– Key repeat On / Off
– Set repeat speed if enable
– Use Long Press or Single Press

And DMD2 can and does use different button settings depending on which app section you are. For example, one button can have a long press function when the user is in the map view but that same button will do repeat when the user is in the Roadbook. In some sections the user can even set all the functions, repeat on/off, repeat speed independently for joysticks and buttons and much more.

This is only possible if DMD2 knows exactly when the user presses a button and then when the user releases the button!

After you successfully make your controller work with DMD2 you should always contact us to make it certified for DMD2 (for free).

Controller Types and Key Codes

DMD2 controller functions are complex and depending on the button amount available we will use each button in different ways. For this reason it is important for DMD2 to know how many buttons are available in your controller. For a perfect implementation nothing beats talking to us, we can make DMD2 identify your specific controller and use one of the following modes:

4 Button Controllers

While developing or if you will not certify it please set the device Bluetooth Name to “DMD2 CTL 4K” so that DMD2 can apply the correct scheme.

Key codes:

  • KEYCODE_DPAD_LEFT
  • KEYCODE_DPAD_RIGHT
  • KEYCODE_DPAD_UP
  • KEYCODE_DPAD_DOWN

5 Button Controllers

While developing or if you will not certify it please set the device Bluetooth Name to “DMD2 CTL 5K” so that DMD2 can apply the correct scheme.

Key codes:

  • KEYCODE_ENTER
  • KEYCODE_DPAD_LEFT
  • KEYCODE_DPAD_RIGHT
  • KEYCODE_DPAD_UP
  • KEYCODE_DPAD_DOWN

7 Button Controllers

While developing or if you will not certify it please set the device Bluetooth Name to “DMD2 CTL 7K” so that DMD2 can apply the correct scheme.

Key codes:

  • KEYCODE_ENTER
  • KEYCODE_DPAD_LEFT
  • KEYCODE_DPAD_RIGHT
  • KEYCODE_DPAD_UP
  • KEYCODE_DPAD_DOWN
  • KEYCODE_F6
  • KEYCODE_F7

8 Button Controllers

While developing or if you will not certify it please set the device Bluetooth Name to “DMD2 CTL 8K” so that DMD2 can apply the correct scheme.

Key codes:

  • KEYCODE_ENTER
  • KEYCODE_DPAD_LEFT
  • KEYCODE_DPAD_RIGHT
  • KEYCODE_DPAD_UP
  • KEYCODE_DPAD_DOWN
  • KEYCODE_F5
  • KEYCODE_F6
  • KEYCODE_F7

Other Information:

Controller Detection & Non-HID:

To keep it it simple DMD2 will detect the controller type by checking the BT Connected devices and match your controller device name with our list of devices. If you have different models that are identifiable by querying a GATT service we can also implement that.

If your controller does not use HID and does everything by GATT services we can also implement that but we will need you to contact us on both cases.

More Complex Features:

If your controller does more than HID key presses, like 360 degree joystick, voltage reading, other sensors input and you would like DMD2 to integrate those functions, please contact us and we will do our best.

Be sure to provide clear instructions!