Tuesday, October 30, 2012

EKH Tutorial 3 - Tweaking some advanced settings

This is the third tutorial for External Keyboard Helper. You'll find the first tutorial here and the second tutorial here.

After some testing I find some things I want to address. First of all since my Targus iPad keyboard uses scancode 139 this conflicts with the menu key on my Samung Galaxy S III so when remapping scancode 139 to Back (see tutorial 2) I also remapped my menu key on the phone.

This I will address using the Device ID filter in the Advanced settings. For most phones the buttons on the phone uses device ID 0 or a negative number. For this the default setting will make sure they are not affected by the remapping in External Keyboard Helper. However for my Galaxy S III running Android 4.1.1 this is not the case.

The first step is to use the Debugging screen to find out what device ID the phone buttons are using so I enter Advanced settings and then Debugging. Pressing the menu button on the phone both confirms that it uses scancode 139 and that it uses device ID 5.



So now I now that I don't want External Keyboard Helper to touch anything that has device ID 5 or lower so I set the Device ID filter to 6.



I also find the keyboard repeat to be a little bit to sensitive for my taste so I change the delay to Slight delay.



I also want to be able to switch between my custom layout (based on the Swedish layout), the Xperia Play layout and no remapping at all so I setup a Language-switch key.




I also check that I want to use a third layout.


I then choose the Xperia Play layout as my second layout and let the third keep it's default setting (No remapping).




This is the end of tutorial 3.

Monday, October 29, 2012

EKH Tutorial 2 - Remapping some keys

This is the second tutorial for the External Keyboard Helper and this time we will create a custom layout and change the mapping for two keys.

If you missed the first tutorial you can find it here.

My Targus iPad bluetooth keyboard have a couple of non standard mappings that I need to fix. To do this I enter the Advanced settings and choose Customize keyboard mappings.



Since this is my first custom layout (you can have two) I choose to put it into the Custom 1 slot.


First I want change the scancode for Back because the "Esc" button on my keyboard does not use scancode 1 for the ESC key as keyboards normally do. So I select the first line in the list which is the scancode-1-to-Back mapping. (This mapping is to make the ESC key send the Back keycode instead of the ESC keycode. Some die hard vim users will want to remove this mapping but for most people having Back mapped to the ESC key is the preferred choice.)


Selecting this line brings up the key mapping dialog.


Since I just want to change the scancode I press the Change button and then press the Esc key to read it's real scancode that turns out to be 139. (Notice that this is a Keycode mapping which is different than the more common Character mapping.)


When I press Save it will actually create a new mapping for scancode 139 and keep the old one. If I want to remove the old mapping I need to select it again press Delete but usually I leave the old ones unless the conflict with something else. As you can see changing the scancode for an existing mapping can be used to copy a mapping. Keep in mind that if a mapping for scancode 139 already exist it would be overwritten without any warning.

I also have one more mapping that I need to change for this keyboard and it's scancode 86 so I press the line for the scancode 86 mapping. (Notice that this is a Character mapping with the Keycode checkbox cleared)


I press Change and press the key on my keyboard that has the < > | signs on it and it turns out that it uses scancode 41.


Pressing save creates a copy of the mapping but now with scancode 41. You can also see the scancode 139 mapping I made in the previous step.


Since I'm done for now I just back out back into the settings menu where I can see that my selected layout has changed from Swedish to Custom 1.


I have now changed the two keys that wasn't using standard scancodes and this is the end of tutorial 2. In the next tutorial we will start doing some tweaks in the advanced settings.