-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host keymaps - conveniently define keymaps with respect to the keymap running on the host #721
base: master
Are you sure you want to change the base?
Conversation
897c20a
to
28ea21b
Compare
I wrote a utility (https://github.com/CapeLeidokos/Kaleidoscope-host_keymap) to convert any existing linux xkb-keymap-variant to a corresponding header that can be used to define host keymaps. All those 633 keymaps have been added in a subdirectory structure of |
Just noticed that I forgot to update the HostKeymap example. That's why travis fails. |
28ea21b
to
325c42e
Compare
325c42e
to
9845406
Compare
Factored out the commit that adds all available GNU/Linux XKB keymaps/layouts/variants. |
a82ce52
to
2315659
Compare
Pushed an update that fixed issues with whitespaces and non word characters in xkb layout and variant names. Added documentation file in |
2315659
to
eb32309
Compare
Pushed an elaborated version of the HostKeymap.ino example. |
Keeping in mind my earlier caveats about back-compat and the fact that I have -not- studied the implementation of this, I ABSOLUTELY LOVE what it get us. |
It probably makes sense for us to build a small tool to generate html keymap tables suitable for users to copy-paste values. |
eb32309
to
7198b5f
Compare
ea011a8
to
a681d72
Compare
a681d72
to
37201a0
Compare
Rebased after conflicts occurred. |
Two new functions have been introduced in namespace kaleidoscope. One to conveniently add keyflags to an existing Key variable and another one that can be overloaded to convert other types to type Key. The keymap definition macros and the modifier function macro (LCTRL, LALT, ...) are now using the to-Key conversion functions. This allows users to use alternative ways to define keymaps by defining types of their own that automatically convert to type Key. Signed-off-by: Florian Fleissner <[email protected]>
This refactors the KEYMAPS(...) macro and factors out a header and footer portion that are now define as individual macros START_KEYMAPS and END_KEYMAPS. The original KEYMAPS(...) macro now relies on the newly defined macros. The newly introduced macros enable keymap definitions that allow for macro definitions between the start and end part which is not possible inside the KEYMAPS(...) macro invocation. Signed-off-by: Florian Fleissner <[email protected]>
host_keymaps enable defining keymaps in a natural fashion. Instead of using Key constants like Key_A or LSHIFT(Key_A) it allows to conveniently write "a" or "A". The mappings between ascii and unicode characters to USB-HID keys works by reverse engineering the host keymaps of a linux system. The information of the provided keymap files allows for precisely figuring out the Kaleidoscope-Key that is needed to generate a specific utf8 character in a given keymap. For non-unicode keycodes, the linux XKB-keysym name is mapped to a Kaleidoscope-Key. The newly introduced host_keymap system is easily extensible and allows users to define their own non-english keymaps, if necessary by extending an existing keymap. Signed-off-by: Florian Fleissner <[email protected]>
Signed-off-by: Florian Fleissner <[email protected]>
37201a0
to
f1d2c45
Compare
Any chance this is going to make it in? I would love to be able to define unicode keypmaps this way!! |
Eventually, we do hope that something like it will land. It’s gonna need some work though.
… On Jun 1, 2020, at 10:17 AM, Fred Callaway ***@***.***> wrote:
Any chance this is going to make it in? I would love to be able to define unicode keypmaps this way!!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
As the first step to getting this or something like it merged, I've pulled in the first several commits from the branch. There's still work I'd like to do to clean up the API, test to see if we can get away with using the same set of keymaps on macos and Windows, and clean up the examples. |
@obra Happy to |
Hi Fred,
That'd be stellar. What level of git experience do you have?
…On Tue, Oct 6, 2020 at 4:28 PM Fred Callaway ***@***.***> wrote:
@obra <https://github.com/obra> Happy to beta test this (on macOS) if it
would be helpful to you. (I know it would be helpful to me!)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#721 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALC2D5I2YT5TIQK35PNXLSJORZJANCNFSM4JMGULGQ>
.
|
I am comfortable working with multiple branches, merging, handling conflicts, and making pull requests. |
Sorry this took a bit, but Fred: wanna give the "pr_host_keymap" branch a
shot?
…On Wed, Oct 7, 2020 at 6:21 AM Fred Callaway ***@***.***> wrote:
I am comfortable working with multiple branches, merging, handling
conflicts, and making pull requests.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#721 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALC2E33YNNIAUARDO34ATSJRTNLANCNFSM4JMGULGQ>
.
|
EDIT: Sorry, false alarm. I am used to error messages showing the important part at the bottom, so I didn't see the real problem, which was easy to resolve. It works! I'm going to play around a bit more and will report back. |
OK, so my hope for this plugin was that I would be able to create a layer with greek letters (for mathematical notation). However, I see now that this would depend on having a corresponding keymap file, and in turn requires having a |
Ah, yeah, that would not really have been easy to do with this PR. What OS
are you on?
…On Thu, Nov 19, 2020 at 11:07 AM Fred Callaway ***@***.***> wrote:
OK, so my hope for this plugin was that I would be able to create a layer
with greek letters (for mathematical notation). However, I see now that
this would depend on having a corresponding keymap file, and in turn
requires having a Key_ defined for each of the greek letters. I'm now
thinking this isn't really feasible :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#721 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALC2DTL7IAIPTVV6EQNE3SQVUG5ANCNFSM4JMGULGQ>
.
|
macos catalina (10.15) |
@fredcallaway, this feature is designed in a way that it enables conveniently defining sketches for language specific keymaps. |
@noseglasses I don't really understand keymaps well enough to know if one exists, but it sounds like @obra doesn't think there is one. I thought that this plugin was actually reading the string in from the keymap and associating it with the key, which would allow for arbitrary unicode (and even multi-character strings?) But I see now that the keymap files just create aliases for various keys. It doesn't actually allow you to map keys to characters that you couldn't before. |
I am using Eurkey layout because I am german. It comes with a lot of umlauts and greek letters AFAIK. I can be easily installed on all major Systems. |
Oh and there's a bunch of math symbols coming with Eurkey as well: https://eurkey.steffen.bruentjen.eu/download/windows/1.3/eurkey-layout-complete.pdf |
Ah this looks promising! But the math symbols are all two-step keys, where you first press alt-m and then press a second key to input the desired character. Is this case handled by your keymap plugin? |
I understand the layout sheet differently. It looks like you have to press AltGr+Shift plus any other key to get a symbol. All of them at once. That can be done with a normal keymap by adding the respective modifiers if necessary. |
This PR introduces host_keymaps, a convenient way to define keymaps like e.g.
See the individual commit messages for a thorough description of the changes as well as the comments in the code that I hope do explain the benefits of this