doc:appunti:android:bluetooth_keboard
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:android:bluetooth_keboard [2020/01/31 17:27] – niccolo | doc:appunti:android:bluetooth_keboard [2020/02/01 13:37] – [Using OsmAnd with a Remote Controller] niccolo | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using OsmAnd with a Remote Controller ====== | ====== Using OsmAnd with a Remote Controller ====== | ||
- | I'm an early joiner of the **OpenStreetMap** project, so I'm a big fan of the **OsmAnd** app. It is my preferred choice for **motorbike on-board navigation**. | + | [{{.: |
+ | I'm an early joiner of the **[[https:// | ||
- | A long-standing issue was the impossiblity to operate the map while **wearing gloves**. To be clear: panning and zooming on the Android touchscreen is impossibile. Here we explore the possibility to use a little Bluetooth remote controller to get at least the **basic pan/zoom functions**; | + | A long-standing issue was the impossiblity to operate the map while **wearing gloves**. To be clear: panning and zooming on the Android touchscreen |
===== The Mocute Universal Wireless Remote Controller ===== | ===== The Mocute Universal Wireless Remote Controller ===== | ||
- | [{{ .: | + | [{{ .: |
- | It is a low-cost (5-10 euros) **Bluetooth** device. It has an internal **rechargeable battery** which should last about 10 hours. | + | It is a low-cost (5-10 euros) **Bluetooth** device, sold under different brands. At present (Jan 2020) you can find it on **Amazon** or **Aliexpress.com** under the generic terms //Android gamepad Bluetooth controller// |
| {{: | | {{: | ||
Line 59: | Line 60: | ||
===== Mocute default key mapping ===== | ===== Mocute default key mapping ===== | ||
- | The Mocute-032 controller has a little slide switch with two positions: **GAME** and **KEY**. Each mode generates different **ScanCodes** for the four buttons. | + | The Mocute-032 controller has a little slide switch with two positions: **GAME** and **KEY**. Each mode generates different **ScanCodes** for the four buttons. **The joystick operates differently**: |
[{{.: | [{{.: | ||
Line 65: | Line 66: | ||
==== The joystick in GAME mode ==== | ==== The joystick in GAME mode ==== | ||
- | In **GAME mode**, each **axis position** is reported as a **floating point number** ragining from **-1.0** to **1.0**, where the **zero** is at the **central position**. When the joystick is pushed near to one side, an **Android KeyCode** is generated. This means that beside the axes position, an appropriate KEYCODE_DPAD_UP, | + | In **GAME mode**, each **axis position** is reported as a **floating point number** ragining from **-1.0** to **1.0**, where the **zero** is at the **central position**. When the joystick is pushed near to one side, an **Android KeyCode** is generated. This means that beside the axes position, an appropriate KEYCODE_DPAD_UP, |
You can see **joystick axes values** with apps like **[[https:// | You can see **joystick axes values** with apps like **[[https:// | ||
Line 101: | Line 102: | ||
- Associate the **X** button to **zoom in**, and **Y** button to **zoom out**. | - Associate the **X** button to **zoom in**, and **Y** button to **zoom out**. | ||
- | In theory - to remap the functions of our controller - it should be possible to provide a **specific keylayout file** for just this controller, just giving it the name **Vendor_ffff_Product_0000.kl** (see the vendor and product read from the ''/ | + | In theory - to remap the functions of our controller - it should be possible to provide a **specific keylayout file** for just this controller: Android' |
So we have to change the **Generic.kl** file, redefining some ScanCodes and axis (the rest of the file must remain untouched): | So we have to change the **Generic.kl** file, redefining some ScanCodes and axis (the rest of the file must remain untouched): | ||
Line 112: | Line 113: | ||
</ | </ | ||
+ | This change have the side effect to remap all the external keyboards that we will connect to our Android device! | ||
===== Key Mapping Test ===== | ===== Key Mapping Test ===== | ||
Using the **[[https:// | Using the **[[https:// | ||
- | Using the **[[https:// | + | Using the **[[https:// |
Using the **[[https:// | Using the **[[https:// |