joncox123 / MotoButtons

Low cost, waterproof controller for motorcycle navigation, phone and media control
GNU General Public License v3.0
22 stars 4 forks source link

MRA Mode Proposal #1

Open harupipapaZZZ opened 1 year ago

harupipapaZZZ commented 1 year ago

Current DMD Mode Cursor mode However, It would be great to be able to control roadbook operations and apps other than DMD2. I think barbuttons( https://jaxeadv.com/barbuttons/using-the-barbuttons/barbuttons-user-guide-v4/ )mode would be helpful. Navigation, roadbook, and media modes would expand the usage. Mode status should be indicated by flashing LED's or multi-color LED's, etc.

joncox123 commented 1 year ago

Sure, I can add those additional modes. I'll check it out. I don't have multicolor LEDs currently, but I could have different flashing patterns.

harupipapaZZZ commented 1 year ago

DMD certified controllers are Many controllers with DMD certification can be used in modes other than DMD2. The problem is that if there are too many modes, it is difficult to know the current mode. In the case of blinking LEDs, constant blinking is too bright, so it is desirable to blink the mode status when a specific button is pressed, or to use color LEDs.

joncox123 commented 1 year ago

That's what a I do currently. Blink when changing modes. An RGB LED could be added for minimal cost. That's something to consider.

joncox123 commented 1 year ago

Hello, I reworked the code to add support for multiple modes. I also added a mode for MyRoute App. As for mode indication, I now flash the top button LED to indicate the mode number: 1 = DMD2, 2 = mouse, 3 = MyRouteApp. I think this works OK and doesn't require another LED.

I'll look into adding the other modes that you mentioned.

harupipapaZZZ commented 1 year ago

That's a quick response!

We're also hoping for a version with a waterproof joystick. I am interested in this

joncox123 commented 1 year ago

The Lite version with the $2.50 joystick is waterproof. But a commercial IP68 rated joystick is about $75 from Digi-Key. I'm pretty happy with this version, actually, so I'm not sure if the commercial IP68 joystick is worth an additional $75. But I did buy a couple IP68 rated switches, so I'll make one anyway. I think the main advantage of the $75 joystick is that its easier to machine the enclosure. Just drill a big hole and screw it in like one of the buttons.

joncox123 commented 1 year ago

Thinking about modes, it seems there are two main tasks. First, add more long press buttons to support changing media/volume during navigation. Second, add a dedicated media mode and the Rally Navigator mode.

Too many modes will make things confusing, however.

How useful is the WonderLINK mode? I have a 2008 R1200GSA, so I have never used the wonder wheel.

harupipapaZZZ commented 1 year ago

Long press is good. Wonderlinq mode for bar button? That's actually unusable. I don't know the actual Wonder Link because I don't use it. However, the action of spinning the wheel is actually a pain. I think the operation of JOYSTEICK is convenient. WonderLink allows you to change keymap assignments with its own connected application. However, it is not possible to switch between multiple keymaps.

DMD2 also uses a long press of enter. This is the DMD2 keycode that I previously found in the Keymapper app. They were also compatible with CARPITER and could be applied to keymaps other than those published. https://drive.google.com/file/d/1d9zDjYazJbee0ePkRAnInIr7Br5FOKJP/view?usp=sharing This is how DMD2 operates in each mode.

In addition to DMD2, ROADBOOK, MAP, and media, If there is a function mode (F1 to F7), users can set any mode using the KEYMAPPER app. (Android only)

harupipapaZZZ commented 1 year ago

Since they use the same keymap, you can integrate ROADBOOK mode and media mode.

You can also combine MAPs into one by referencing bar button keycodes and assigning a keymap that can be used by multiple apps.

1.DMD2,

  1. MAP,
  2. Media & ROADBOOK,
  3. Function mode The above four modes may be good.
joncox123 commented 9 months ago

I have been quite busy at work lately, but I plan to add a media mode and skip waypoint for MyRouteApp. Let me know if there are other ideas.

Joergen57 commented 9 months ago

Hi Jon, you're still alive. ;-) If you could add something to skip waypoints in MRA that would be fine. Bike session starts soon. Or if you could give a hint what to change or what to add in the code, that would help as well. I have someone that could change it in the code.

joncox123 commented 8 months ago

media (music) mode has been added as a forth mode. Also, if I read the MyRouteApp instructions correctly, holding down the menu key ("n") for a long time should activate skip waypoint. I haven't tested this since I don't have a MRA subscription, but please give it a try. If it doesn't work, I could add another virtual key for skip waypoint, such as long press of button A or something.

Joergen57 commented 8 months ago

Hi Jon, I am happy that you are back and can follow up. There are two function for MRA, one needs to be implemented and one needs an update. Center Joystick one click send a "c" ok is working for center map. Center Joystick long press send a "n" for menu, but it sends a lot of nnnnnnnnnnnnn that confuse MRA. What options are possible? Send only one "n" or make a pause for the next on, then you know to release the button?

Next is sending a "d" for skip waypoint. A friend has tried this for me to place in the code. This was set to the first button (A) with long press. Here also it should send only one "d".

I find it also difficult to use the center button from the Joystick, is it may be possible to add "n" as long press to the other button in front (B)? Is it possible that the buttons are reversed? Means B is in front than A. I send you the changes we made, dont ask me details, I have no clue about programming. :-(

harupipapaZZZ commented 8 months ago

Suggestion(1) Pressing the ENTER button in MRA mode Is it possible to send the key code ENTER+C+L?

For bar buttons, send ENTER + C + L in sequence. C = Center Map (Osmand, Kurviger 2, MyRouteApp, etc.). L = Central map/tracking mode change (Guru map). Enter = Center Map (Kurviger 3) can be made to correspond to

This allows you to move the cursor up/down/left/right on the Android home screen and select apps with the center button, just like in DMD mode.

I set DMD mode to CENTER = HID_KEY_C; (center of map) A = HID_KEY_EQUAL; (zoom in) B = HID_KEY_MINUS; (zoom out) Virtual = HID_KEY_D; (Menu selection ◀▶) It has been changed like this, CENTER =ENTER + C + L This allows DMD and Osmund to be used in the same mode.

Suggestions (2) I think you can set it to hold button A and button B in MRA mode. I don't think it's practical to long press to zoom in or zoom out.

const uint8_t MRA_KEY_UP = HID_KEY_ARROW_UP; const uint8_t MRA_KEY_DOWN = HID_KEY_ARROW_DOWN; const uint8_t MRA_KEY_LEFT = HID_KEY_ARROW_LEFT; const uint8_t MRA_KEY_RIGHT = HID_KEY_ARROW_RIGHT; const uint8_t MRA_KEY_CENTER = HID_KEY_ENTER + KEY_C + KEY_L; const uint8_t MRA_KEY_A = HID_KEY_EQUAL; const uint8_t MRA_KEY_B = HID_KEY_MINUS; const uint8_t MRA_KEY_VIRTUAL = HID_KEY_D; const uint8_t MRA_KEY_VIRTUAL_A = HID_KEY_N; const uint8_t MRA_KEY_VIRTUAL_B = HID_USAGE_CONSUMER_PLAY_PAUSE;

If this is it Can be used in common with DMD, MRA, and Osmund. Then press and hold the B button to play music.

harupipapaZZZ commented 8 months ago

I made a mistake. const uint8_t MRA_KEY_A = HID_KEY_EQUAL; MRA needed to expand. Then DMD, OSMAND, and MRA can be used in common.

I don't have an MRA license either, so this is a trial version. MRA_KEY_A = HID_KEY_KEYPAD_ADD Instead of MRA_KEY_A = HID_KEY_KEY_EQUAL It has been expanded.

Joergen57 seems to have a license. Please test it with KEY MAPPER etc.

Joergen57 commented 8 months ago

Hi, two things I noticed in MRA mode.

  1. long press center to open menu is difficult to find right timing, because menu close very quickly.
  2. long press A button (zoom minus) to get a "d" for skip waypoint forces MRA first to zoom out and then skip waypoint.*

*This belongs to the changes I made (see above).

It would be nice if the zoom buttons in/out +/- only send one command by pressing, so one + and one - not endless until you release button.

harupipapaZZZ commented 8 months ago

Joergen57

As a suggestion, if you press and hold the center button for D, wouldn't it be possible to skip the waypoint (center position) and not be affected by the short press of the center button?

N button changed to long press of A (But do you ever open the menu while driving?)

Joergen57 commented 8 months ago

I am not sure. Yes, skip waypoint seems to be more important than the menu. I like more the A/B buttons, then the center joystick button, I think it is not good with gloves.

And, yes I sometimes need the menu.

harupipapaZZZ commented 8 months ago

Press ENTER button in MRA mode Is it possible to send the key code ENTER+C+L?

I tried using keymapper

However, it didn't work as expected. When you press CENTER, the C+L key code is sent first, so the characters are entered into Google search and it doesn't work as expected.

Maybe using send when key is pressed and send when key is released might work, but I can't test it.

A simple solution is It is necessary to set the A button and B button to be held down. Make settings as below

const uint8_t MRA_KEY_UP = HID_KEY_ARROW_UP; const uint8_t MRA_KEY_DOWN = HID_KEY_ARROW_DOWN; const uint8_t MRA_KEY_LEFT = HID_KEY_ARROW_LEFT; const uint8_t MRA_KEY_RIGHT = HID_KEY_ARROW_RIGHT; const uint8_t MRA_KEY_CENTER = HID_KEY_ENTER const uint8_t MRA_KEY_A = HID_KEY_EQUAL; const uint8_t MRA_KEY_B = HID_KEY_MINUS; const uint8_t MRA_KEY_VIRTUAL = HID_KEY_D;

const uint8_t MRA_KEY_VIRTUAL_A = HID_KEY_N; const uint8_t MRA_KEY_VIRTUAL_B = HID_KEY_C; I can't try it because I don't have the skills to change the program, but You should now be able to control DMD, OSMAND, MRA, and the Android home screen. and with that MRA mode It might be best to set the A, B, and middle buttons to not repeat. Virtual too