Closed scottbmc closed 4 years ago
Unfortunately no others yet. Please specify what could be reasonable to support.
Would be nice to be able to scroll the map with the controller or the arrow keys on keyboard and zoom in/out with plus/ minus key.
KEYCODE_DPAD_RIGHT (22) scroll right KEYCODE_DPAD_LEFT (21) scroll left KEYCODE_DPAD_UP (19) scroll up KEYCODE_DPAD_DOWN (20) scroll down KEYCODE_PLUS (81) zoom in KEYCODE_MINUS (69) zoom out
With this you should be able to build your own controller for OSMAnd like for a motorcycle or a bicycle, at least with remapping keys of your specific controller/ keyboard .
Other functions could follow but this should be e great start
Thanks for adding these keycodes. Sadly they didn't work as expected. Yes it moves the map and I can zoom in and out but it's not a scrolling but only like one little step for each keypress. So no continuous scrolling. I tried this with an external keyboard via OTG cable and the arrow keys and a Bluetooth game controller which hasKEYCODE_DPAD_RIGHT, LEFT, UP, DOWN as output with the joystick. I checked it with a remap app that gives me the keycodes.
Hello i have seen this and i would just like to add functions accessible trough keyboard (i have a phone with keyboard). I love geolocated notes so it is only link to this. Sorry i don't know the keycode corresponding to the leter : "a" to launch a audio record "p" to make a picture "v" to make a video
Sadly they didn't work as expected. Yes it moves the map and I can zoom in and out but it's not a scrolling but only like one little step for each keypress. So no continuous scrolling.
I agree fully. I'm looking for solution for motorcycle riding, combined with external handlebar remote. SCROLL in current mode is useless. Alternative solution would be scroll (shift) in larger steps. Step size should be definable trough UI in relative (or absolute) measures. This gives user ability to scroll (shift) screen with just on click to desired direction by predefined distance.
I suggest using something relative for the scrolling, like screen size. Would be less precise than absolute measure but understandable to anyone. Either percentage (steps in 10% should suffice) or fractions (1/1, 1/2, 1/3, 1/4, 1/5 etc).
Alaso add CENTER/HOME keycode to the mix for quick centering of screen.
We are starting with this KEYCODE_DPAD_RIGHT (22) scroll right KEYCODE_DPAD_LEFT (21) scroll left KEYCODE_DPAD_UP (19) scroll up KEYCODE_DPAD_DOWN (20) scroll down KEYCODE_PLUS (81) zoom in KEYCODE_MINUS (69) zoom out
where scroll will be 33% shift. If you have a key for map center please share so we could add this release
Since my current controller don't have a center key, i would suggest just using KEYCODE_BUTTON_THUMBL (106) for now.
Key code constant: Left Thumb Button key. On a game controller, the left thumb button indicates that the left (or only) joystick is pressed.* @apiSince 9 Constant Value: 106 (0x0000006a
According to developer.android.com
The current cotroller do have some additional keys but with a key remapping app it's easy to remap one of these to be the this one.
Hey Guys. I hope I am not too late for this round. We developed a programmable remote controller for motorbikes and some users are asking for better support for osmand. Please check here: https://carpe-iter.com/
Currently we are using touch gestures simulation to control osmand (and other apps that do not have native support for hardware controls), but that is not ideal.
Is there a change to get: a. map panning bound to arrow keys (up/down/left/right) (our controller reports, among other things, as HID keyboard), b. zoom out: KEYCODE_NUMPAD_SUBTRACT c. zoom in: KEYCODE_NUMPAD_ADD d. map centering: KEYCODE_C e. map orientation north up/direction of travel toggle: KEYCODE_R
We have all together 14 available slots, so if you think there is any other useful function, feel free go wild;-) I am not using Osmand personally, so I do not know what could be useful to the users. if there is a way how to skip to another waypoint, that would be a great feature. Like e.g. skip to another waypoint + recalculate route combo on single shortcut.
BTW, for the scrolling step is ideal 70% of the respective (UP/Down, Left/Right) screen axis. 33% is too small increment in my opinion.
Is there any code for centering? I would add one for that function as well.
70% shift sounds about right.
I like CI Control ;-) It would be ideal to have a configuration for mapping input device events to application actions. I would see many other uses. For example: start recording a track, add your current position to favorites, take photo, etc.
btw, we can also do Intent Broadcasts, in case this way of controlling Osmand (or other app) would be simpler to adopt than shortcuts. Making a map respond to arrows (dpad) is not a simple thing. On the other hand dpad is better for general use - moves map but when a menu is opened, it can be used to navigate the menu items.
It is highly desiderable the possibility to remap keys (to assign program function to a choosen keypress), so you can operate with different devices emulating keyboards, keypads or joysticks. There some interesting devices, but each one uses its own keys:
Anyway I think that using plain keyboard key codes is preferable, rather than using joystick or other hardware buttons, so we can remap them more easily.
In my opinion we should prioritize simple operations that can be done with a small set of keys. E.g. I think it is usefull a button to record a waypoint without entering a description (which will require a full keyboard). More problematic are functions which will require further keypresses or screen interactions, like shooting a video. Also programming a destination is too complex to be achieved on a simple pad.
This is because in my opinion the focus should be an external devices with a few buttons, suitable for motorbike handlebar or car steering wheel: just four directions, zoom in and out, plus a few other optional functions.
If I'm asked on desiderable functions, this is my priority list:
It is highly desiderable the possibility to remap keys (to assign program function to a choosen keypress), so you can operate with different devices emulating keyboards, keypads or joysticks. There some interesting devices, but each one uses its own keys:
- Daytona Smartphone controller - Uses Enter, Power, Escape, Home, Joystick.
- Carpe Iter Control - Seven programmable keys, with two functions each.
- ACGAM R1 Bluetooth - Emulates joystick or mouse, multimedia keys.
Anyway I think that using plain keyboard key codes is preferable, rather than using joystick or other hardware buttons, so we can remap them more easily.
In my opinion we should prioritize simple operations that can be done with a small set of keys. E.g. I think it is usefull a button to record a waypoint without entering a description (which will require a full keyboard). More problematic are functions which will require further keypresses or screen interactions, like shooting a video. Also programming a destination is too complex to be achieved on a simple pad.
This is because in my opinion the focus should be an external devices with a few buttons, suitable for motorbike handlebar or car steering wheel: just four directions, zoom in and out, plus a few other optional functions.
If I'm asked on desiderable functions, this is my priority list:
- Scroll in the four directions. Auto-repeat keys is desiderable, the step implemented in v.3.5.5 is too little.
- Zoom in/out
- Center the map on my position
- Record a waypoint, with no further keyboard input
I completely agree, but unless there is any serious reason why not, I suggest to map zooming to other shortcut / keycode than volume control or other multimedia keycodes. It would be best to keep the multimedia controls for multimedia (on CI Control you can control your gps app and e.g. Spotify at the same time by programming the appropriate command to the buttons/joystick). If you use media control for controlling gps app (Osmand), it would prevent controlling the music app (you would need to register Osmand for the media buttons and than the keycodes are not passed to the other apps running on background).
Keycode ADD / SUBTRACT for zoom works better than "PLUS" / "MINUS". There is no single key equivalent on usb keyboard for Android keycode "PLUS".
P.S. re daytona - it will not be able to utilize the remapping function. The only keys you could use on that are the dpad (arrows) on joystick. Enter, power, escape, home are system commands. You cannot influence how these are handled by the system, so they will always have their initial affect on system level
Hi, I made some test drive with a Bluetooth Mocute Wireless Controller.
It is a very small gamepad with eight keys: a 4-positions joypad and 4 action buttons. It can be configured in two modes: KEY and GAME, by sliding a little switch. In KEY mode it maps keys to Android multimedia functions (MEDIA_NEXT, VOLUME_UP, ENTER, ...). In GAME mode it maps to Android joypad buttons (DPAD_UP, DPAD_RIGHT, BUTTON_A, ...).
The preferred approach for OsmAnd shuld be a configurable mode (to manually associate Android key code to OsmAnd functions). Otherwise an hard-coded joypad mode is prefereble than a generic keyboard mode. Consider the zoom funcion: PLUS and MINUS keys exist only in keyboards, but not in keypads or joypads.
So my preferred mapping is:
KEYCODE_DPAD_UP = Scroll Up KEYCODE_DPAD_DOWN = Scroll Down KEYCODE_DPAD_RIGHT = Scroll Right KEYCODE_DPAD_LEFT = Scroll Left KEYCODE_BUTTON_A = Zoom In KEYCODE_BUTTON_B = Zoom Out KEYCODE_BUTTON_X = Center map on my position KEYCODE_BUTTON_Y = Record a Waypoint
Also the OsmAnd action should be triggered by the KeyDown event instead of KeyUp, so that the Repeat should work out-of-the-box.
At the present, I was able to use very nicely that controller by modifying the default keylayout /system/usr/keylayout/Generic.kl, associating my ScanCodes to OsmAnd expected key codes. But this requires root access.
P.S. re daytona - it will not be able to utilize the remapping function. The only keys you could use on that are the dpad (arrows) on joystick. Enter, power, escape, home are system commands. You cannot influence how these are handled by the system, so they will always have their initial affect on system level
Hi
I have the Daytona remote. I remapped the home, esc and enter buttons to do other stuff (like + and - for example) and it worked nice, even on an unrooted Android. So you CAN actually utilize all of the buttons on this remote nicely if you use a third party button mapping software.
I have the Daytona remote. I remapped the home, esc and enter buttons to do other stuff (like + and - for example) and it worked nice, even on an unrooted Android. So you CAN actually utilize all of the buttons on this remote nicely if you use a third party button mapping software.
Please @morse87, can you tell me something about the "third party button mapping software"? Is there some app on the Google Play? Does it work without root? I'm aware only of Android keylayout files to remap ScanCode to KeyCodes, but that requires root.
Hi
I use button mapper pro. I can choose what happens when i push each button.
For example “home” button. I can choose different outcome for single press, double press and long press.
I can set it to send shell command, broadcast intent, custom keycode, open URL etc
So pretty much everything. And it is cheap and simple.
But when I change what the home button does, then it will change the actions of both the home button on the daytona remote and on the actual home button on my Kyocera Duraforce pro android phone...
On Fri, 31 Jan 2020 at 17:02, Niccolo Rigacci notifications@github.com wrote:
I have the Daytona remote. I remapped the home, esc and enter buttons to do other stuff (like + and - for example) and it worked nice, even on an unrooted Android. So you CAN actually utilize all of the buttons on this remote nicely if you use a third party button mapping software.
Please @morse87 https://github.com/morse87, can you tell me something about the "third party button mapping software"? Is there some app on the Google Play? Does it work without root? I'm aware only of Android keylayout files to remap ScanCode to KeyCodes, but that requires root.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/osmandapp/Osmand/issues/7295?email_source=notifications&email_token=AONUGQBIPTU2BMQ72NS5BOLRAQ4OTA5CNFSM4IFMDGE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKO5IDY#issuecomment-580768783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AONUGQBRXEHXXAXWYOHZOOTRAQ4OTANCNFSM4IFMDGEQ .
PS! I checked my Daytona remote just now. It outputs next keycodes by default: DPAD_UP 19 DPAD_DOWN 20 DPAD_LEFT 21 DPAD_RIGHT 22 ENTER 66 HOME 3 ESCAPE 111
Base actions were added, please feel free to check and comment. It might be needed to open new issue to add other actions cause this one is going to be closed for release 3.6
Any solution for moving UP/DOWN/LEFT/RIGHT on map ? I tried KEYCODEDPAD* but they do not work.
Is there a possibility to add in the configuration menu which key maps to which action? The problem is that different applications have different key mappings. Using apps like "mapper pro" is not practical because you need to change the key definition each time you switch to different applications. Ability to defined key to action mapping inside Osmand would really help people that use two applications with the same controller at the same time. My example, I use DMD2 for roadbook and OBD2 information but I use Osmand+ for navigation. Both applications use different mappings on my Barbuttons controler and it would be nice if I can manually map buttons in Osmand+.
@omadon probably this article may help you https://osmand.net/docs/user/map/interact-with-map/#external-input-device-buttons
@omadon probably this article may help you https://osmand.net/docs/user/map/interact-with-map/#external-input-device-buttons
Thanks, I found that page but keys are hard-coded in to the application. It would be nice if we can change key->action mapping in the configuration menu.
Sounds like separate feature request. At the same time, the UI for this option would be too complex and cluttered.
With the last Update on Android ver. 3.4.3 i noticed support for external input devices such as generic keyboard etc.
What key events or key codes does osmand expect and for what action? I cannot find any infos about that. I try to use osmand with an external bluetooth controller. With a keymapper i can remap every key to a key code but i cant get the map to scroll.
The only keycodes i figured out are dpad_down (20) and dpad_up (19) for zoom out and in. So are there more? like scroll etc?