9

I have an Samsung Galaxy 10.1 running Android version 4.1.2. I am using ssh to remotely connect to my main machine which runs Ubuntu 12.04 LTS. Once I am connected I do all my work in emacs 24.3. I also have a bluetooth keyboard.

My question is about remapping the Caps Lock key to function as the Ctrl key. I do this with my main machine by changing a setting in the terminal options. I checked the options in juiceSSH and there appears to be no equivalent. Perhaps there is a general way to do this with Android or the Bluetooth Keyboard.

How can I remap the Caps Lock character to function as the Ctrl character?

If you need more information let me know.

3 Answers 3

8

I managed to remap the Caps Lock key to Ctrl using External Keyboard Helper Pro. It was really straightforward, just poke around in the settings and you'll find a way to create a custom mapping (Keycode 58 --> Left Control).

2
  • 2
    Note that you need to enable the "Keycode" checkbox when editing the mapping, then select "Left Control" from the dropdown. Also you need to enable the "Override special keys" option on the "Keyboard mapping" option page otherwise the key still functions as Caps Lock in addition to Ctrl.
    – markshep
    Commented May 19, 2015 at 22:53
  • 1) If you press caps lock to initiate the keycode 58, this will lock this keycode in. Then press caps lock again. Otherwise, after activating your custom layout, you would always type everything capitalized. 2) I could replicate the desired behavior in Android this way. However, caps lock is simply inactive then (instead of 'control') inside Emacs running inside Linux for DeX, for example, which runs Ubuntu 16.04. Also other trials (setxkbmap -option ctrl:nocaps or dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:ctrl']") did not respect caps lock as control unfortunately Commented Jun 1, 2019 at 15:49
3

Since Android 4.1 you can do it without root by installing an app that provides additional keyboard layouts (Key Character Map files).

The example of such app could be found here (I'm the developer).

If you don't familiar with Android development and/or don't want to build such app, there is web-app to do it (I'm the developer). It's free and open-sourced.

The KCM file to make CapsLock acts like Ctrl should look like

type OVERLAY

map key 58 CTRL_LEFT

UPDATE:

As Ronald Rogers said in the comments: Note you have to pick "ExKeyMo Layout" for all of your keyboards in your "Physical Keyboard" settings for this to work.

UPDATE:

ExKeyMo web app is not available on Heroku anymore. You'll have to run it locally. See the project's page on GitHub.

1
  • 2
    Note you have to pick "ExKeyMo Layout" for all of your keyboards in your "Physical Keyboard" settings for this to work. Commented Dec 11, 2022 at 19:50
0

If you have rooted the device, and are able to remount /system as read-write, then you can do it by editing the files in /system/usr/key*. Here is an example with detailed instructions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .