Jump to content
Craig

Key Mapper: FOSS app to bind keys & buttons to other keys or actions

Recommended Posts

Do FinQwerty and KeyMapper serve the same purpose?  I haven't installed either, just curious.  Is the difference that FinQwerty replaces keyboard map files with prebuilt ones or user created (created outside the app), and KeyMapper is modifying the files while you are in the app?  Or does KeyMapper not modify files at all, and is just intercepting keystrokes?

  • Like 1

Share this post


Link to post
Share on other sites
41 minutes ago, david said:

Do FinQwerty and KeyMapper serve the same purpose?  I haven't installed either, just curious.  Is the difference that FinQwerty replaces keyboard map files with prebuilt ones or user created (created outside the app), and KeyMapper is modifying the files while you are in the app?  Or does KeyMapper not modify files at all, and is just intercepting keystrokes?

Finqwerty is not an 'active' app. It 'just' presents the system with some alternative pre-fabricated .kcm keymaps, and lets the system do all the active work.

The KeyMapper is installed as a keyboard driver, that is an active app, and let you map things one by one. Nice versatility, but quite a bit of work to set up fully. I do not know if the setups can be exported and edited in an editor and reimported though - that could help.

(Unless I'm mistaken the keymapper only handles individual keys not combinations, but i could be wrong)

KeyMapper requires a LOT of high privileges, so not something I would be happy with on a daily device...

  • Thanks 3

Share this post


Link to post
Share on other sites

So does FinQwerty modify /system?  I've never messed with keyboard map files in the past.  

Or, I guess the other way to ask that is, what is the difference between a person copying the files to a specific location vs FinQwerty doing it?

Edited by david

Share this post


Link to post
Share on other sites

Finqwerty doesn't modify anything. It just adds some layout files that you select the same way as the included ones.  It's just the included ones are default (not customized for our device) and assume we have standard hardware keys available.  Since we dont have slash key, we need a unique layout to get slash and question mark.

Keymapper allows you to map keys & buttons or combinations or longpress keys or whatever.  See the details in the first post spoiler section or read about it on fdroid or play store.  You would not want to use that to create a whole layout. 

They serve different purposes and it makes sense to use both if desired.  The only reason finqwerty overlapped into this thread is because one of the reasons I personally use keymapper is to get slash key.  Finqwerty is another solution for that.   But there's other actions keymapper can do besides change a key to another key.    See my first post for examples of how I used it.   Plus, you cannot customize anything within finqwerty, if you want a change you have to build repackage from source.

You cannot export/import profiles currently in kemapper.  I did ask the author about that, he said he's planning to add that feature this coming summer, but busy with studies now for anything besides critical bug fixes. 

I don't recall it needing any odd permissions, but its open source, nothing to worry about, certainly safer than random stuff from play store - if you want to know why it needs a permission, you can look at the source and figure out why.

Edited by Craig
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Craig said:

Finqwerty doesn't modify anything. It just adds some layout files that you select the same way as the included ones.  

What I meant is, does it write those new layout files to the /system partition?  Is that where they are stored?

Share this post


Link to post
Share on other sites

I'm only vaguely repeating some stuff I read sometime elsewhere... but no, it saves them in the normal place apps use, but the actual app itself is using some api to get those loaded without requiring root.  But there is an actual app that runs at bootup or something that loads them, they're not stored in system like the normal ones.

  • Thanks 1

Share this post


Link to post
Share on other sites
10 hours ago, david said:

So does FinQwerty modify /system?  I've never messed with keyboard map files in the past.  

Or, I guess the other way to ask that is, what is the difference between a person copying the files to a specific location vs FinQwerty doing it?

First of a user would not be able to copy files in without root.

Secondly I'm not even sure the files are actually copied, but are merely presented to the system somehow (I do not know the specifics, but can not find the .kcm files copied in anywhere) and I guess that is also why FinQWERTY does not ask for privileges.

As I understand it, the .kcm files has to be baked into the apk, and that is why there are no import/export in FinQWERTY. But I might have misunderstood. Hopefully @Anssi Hannula can chip in with the correct info?

 

ADD: See this related simpler example

<receiver
  android:name=".InputDeviceReceiver"
  android:label="@string/keyboard_layouts_label">
  <intent-filter>
    <action android:name="android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS" />
  </intent-filter>
  <meta-data
    android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS"
    android:resource="@xml/keyboard_layouts" />
</receiver>

I assume that is indicating that Android is to fetch the files from the APK, and not copy it to a disk location (the source of FinQWERTY is somewhat similar here)

Share this post


Link to post
Share on other sites
3 hours ago, EskeRahn said:

I assume that is indicating that Android is to fetch the files from the APK, and not copy it to a disk location (the source of FinQWERTY is somewhat similar here)

So if you uninstall FinQWERTY, do the layout options disappear from the Android UI?

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, david said:

So if you uninstall FinQWERTY, do the layout options disappear from the Android UI?

They do. 

  • Thanks 2

Share this post


Link to post
Share on other sites

Do either of these provide a way to auto capitalize when typing?  I am not clear on what controls things like that.  It is one of the main things I am having a hard time adjusting to on the Pro1 vs my old phone.

Share this post


Link to post
Share on other sites
1 minute ago, david said:

Do either of these provide a way to auto capitalize when typing?  I am not clear on what controls things like that.  It is one of the main things I am having a hard time adjusting to on the Pro1 vs my old phone.

If not mistaken Swiftkey can do that for you.

  • Thanks 3

Share this post


Link to post
Share on other sites

I don't know if Swiftkey does the auto-capitalize.

I uninstalled Swiftkey.  The conveniences it provided the physical keyboard did not outweigh how awful it is at swyping with the onscreen keyboard.  Since I now only use onscreen keyboard (portrait) when I'm going for speed, having an onscreen keyboard that slows me down is a deal breaker.  I'm sure part of it is I have been using Gboard for years, but it is also that Swiftkey is just not as good with swyping.  I've been told it's better at international typing, tho.

I don't miss the auto-capitlize because, with a physical keyboard, I find it natural to hit shift when I begin a sentence lke any othe physical keyboard I have ever used. Then again, this is my first landscape keyboard.

Edited by Hook

Share this post


Link to post
Share on other sites
1 hour ago, david said:

Do either of these provide a way to auto capitalize when typing?  I am not clear on what controls things like that.  It is one of the main things I am having a hard time adjusting to on the Pro1 vs my old phone.

Besides switfkey as netman mentioned as workaround, hopefully that's coming to stock in next OTA.  It's a simple thing for them to fix, they have to define our keyboard as alpha (thumb keyboard) and then you get optional auto-caps, sticky shift/alt, longpress ltters get you accented letters popup, etc.    They accidentally defined it as a full sized keyboard for touch typing, so Android is doing the behavior intended for when someone connects a full sized keyboard thru usb/bt.

Edited by Craig
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, netman said:

If not mistaken Swiftkey can do that for you.

Perfect! It took some time to configure it the way I want, but it solved for almost everything. It took me a while to get "i" to auto cap. I had to enable autocorrect by tapping on that icon. It can be a bit odd about learning some shorthand capitalization I use with a friend, but I seem to be able to get it to work eventually, if I keep trying. 

The only 3 things it doesn't have for the physical keyboard settings are:

- No double space to insert a period. That setting is only in the generic settings, not in the physical keyboard settings.

- When you type punctuation, it inserts a single space. I believe in double spacing after periods, so this one bugs me.

- It doesn't auto cap after ? and !.

UPDATE:  Now, I just found out that if you disable "smart punctuation spacing", that it does auto cap after ? and !.  It won't add the single space after you type punctuation, but in my case, that might be preferable, because I can now double space the way I want.  With auto space, it required typing 2 spaces after the auto space in order to get two instead of one.  That caused me to pause, since the first space appeared to do nothing, so it wasn't clear if I had hit the space bar key.  It does mean I have to manually space after commas too now, but that is okay.  Strange that feature would affect auto cap after certain end of sentence punctuation though.

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Craig said:

Besides switfkey as netman mentioned as workaround, hopefully that's coming to stock in next OTA.  It's a simple thing for them to fix, they have to define our keyboard as alpha (thumb keyboard) and then you get optional auto-caps, sticky shift/alt, longpress ltters get you accented letters popup, etc.    They accidentally defined it as a full sized keyboard for touch typing, so Android is doing the behavior intended for when someone connects a full sized keyboard thru usb/bt.

That sounds nice.  Sticky would be nice too.  Will it learn words?  With SwiftKey, I can teach it to capitalize certain words.

Thanks for explaining.  I was wondering why a keyboard phone would ship without some of these features being there by default.

Share this post


Link to post
Share on other sites
7 minutes ago, david said:

That sounds nice.  Sticky would be nice too.  Will it learn words?  With SwiftKey, I can teach it to capitalize certain words.

Thanks for explaining.  I was wondering why a keyboard phone would ship without some of these features being there by default.

Here's the details from android source (emphasis added):

 

https://source.android.com/devices/input/key-character-map-files

  • ALPHA: A keyboard with all the letters, and maybe some numbers.

    An alphabetic keyboard supports text entry directly but may have a condensed layout with a small form factor. In contrast to a FULL keyboard, some symbols may only be accessible using special on-screen character pickers. In addition, to improve typing speed and accuracy, the framework provides special affordances for alphabetic keyboards such as auto-capitalization and toggled / locked SHIFT and ALT keys.

    This type of keyboard is generally designed for thumb typing.

  • FULL: A full PC-style keyboard.

    A full keyboard behaves like a PC keyboard. All symbols are accessed directly by pressing keys on the keyboard without on-screen support or affordances such as auto-capitalization.

    This type of keyboard is generally designed for full two hand typing.

Edited by Craig
  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Oh, and it took me a while to find the options to make the predicted text tiny (since I will rarely use it, except to teach it new words for auto cap), and to hide the icon bar.  Also, I could have sworn that it appeared above the typing line at first, but I somehow got it to appear under, where I want it. 

Much better, for me, than the way it was.  I try to minimize virtual keyboard use at all costs (to save what sanity I have left), and do not use swype on virtual keyboards when I very rarely use them, so this is a good solution for me.  I will try the alpha option when fxtec changes that.

Share this post


Link to post
Share on other sites
8 minutes ago, david said:

That sounds nice.  Sticky would be nice too.  Will it learn words?  With SwiftKey, I can teach it to capitalize certain words.

Thanks for explaining.  I was wondering why a keyboard phone would ship without some of these features being there by default.

I agree that they went a little bit TOO "stock android" there.

As the keyboard is THE main feature of a Pro1, I did expect a more polished Keyboard software. But this is all software, so it is just my lack of patience, and at the least we got workarounds for most of the keyboard issues with FinQwerty and Swiftkey until OTA gives a better experience stock.

  • Like 2

Share this post


Link to post
Share on other sites

I noticed that you are able to change virtual keyboard without root with Keyboard Switch Assistant. What makes it even greater is that you are able to make shortcut (for example ctrl + K) for the keyboard switch with Keyboard/Button Mapper and Nova actions. So I installed Hacker's Keyboard and enabled "Show soft keyboard: Always" from its settings. Normally I use Gboard so I don't see virtual keyboard when physical keyboard is opened. However, now I can bring up or hide Hacker's Keyboard with the shorcut (ctrl + K) when the physical keyboard is open.

Hacker's Keyboard supports language packs from AnySoftKeyboard. I think that we could make a layout for special characters and use that as a default for Hacker's Keyboard. Then when you toggle Hacker's Keyboard up you could have special characters there.

I got this idea from the Lineage OS feature thread. The idea is to create similar feature to stock like below.

Screenshot_20200224-200326_Terminal.png

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Can you bring up a different keyboard for different special key combinations (or long presses)?  If so, that would be a way to implement what @EskeRahn has mentioned as an idea to have multiple levels of special characters available for each physical key.  It would also require the button mapper allowing for key combinations to represent those keys on the physical keyboard, not just tapping them on the virtual keyboard, which would be more of a "cheat sheet"/reminder of which physical key combinations map to special characters.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, david said:

Can you bring up a different keyboard for different special key combinations (or long presses)?  If so, that would be a way to implement what @EskeRahn has mentioned as an idea to have multiple levels of special characters available for each physical key.  It would also require the button mapper allowing for key combinations to represent those keys on the physical keyboard, not just tapping them on the virtual keyboard, which would be more of a "cheat sheet"/reminder of which physical key combinations map to special characters.

I can toggle between different keyboards but only Hacker's Keyboard has a build in option to enable virtual keyboard while physical keyboard is open. So when I toggle to Gboard it will not appear.

Another option is to use Keyboard Switcher which will bring up pop up to select keyboard when I press shortcut combo. There is also an option to show every virtual keyboard while physical keyboard is open.

Screenshot_20200226-103020.thumb.png.72e0e0fe4a8b1e16103981e667f76e5a.png

Edited by FlyingAntero

Share this post


Link to post
Share on other sites
1 hour ago, FlyingAntero said:

I can toggle between different keyboards but only Hacker's Keyboard has a build in option to enable virtual keyboard while physical keyboard is open. So when I toggle to Gboard it will not appear.

Another option is to use Keyboard Switcher which will bring up pop up to select keyboard when I press shortcut combo. There is also an option to show every virtual keyboard while physical keyboard is open.

That is not quite the idea.

The idea is that if we map a truckload of different symbols to all kinds of odd modifier combinations, e.g. Shift+Ctrl+YellowArrow+[key] it would be great if e.g. just holding the modifiers a little long would pop-up the relevant cheat-sheet.

Share this post


Link to post
Share on other sites
22 minutes ago, EskeRahn said:

That is not quite the idea.

The idea is that if we map a truckload of different symbols to all kinds of odd modifier combinations, e.g. Shift+Ctrl+YellowArrow+[key] it would be great if e.g. just holding the modifiers a little long would pop-up the relevant cheat-sheet.

It is also possible to bring up a floating note but I haven't been able to select specific note. I can only bring up an empty note (new, not previously saved).

I used this app for floating note.

https://play.google.com/store/apps/details?id=com.ashk.minifloatingnotes.lite

  • Like 1

Share this post


Link to post
Share on other sites

I made a quick video of the shortcuts to bring up virtual keyboard or floating notepad. If we can make keyboards with different layouts as default then it would very usable. You could just bring up a virtual keyboard for special needs. For example in the situations when you are looking for specific character that you can't find from the physical keyboard.

 

  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Terms