Keyboard and Keystrokes, Alternative Solutions (Formerly "Karabiner, How Safe?")

@Tom, @eurobubba

Thanks for your suggestions.

I have seen Karabiner used - apparently quite successfully - in the MacSparky videos on KM as a way to free up additional combinations. And others mention it here as a bit of a standard tool.

I do keep an ultra-clean machine, so am nervous about the kind of conditions you ran into Tom - especially apparently random, or 'timed misbehaviour' :frowning:

All I need to do, really, is have a good 20/two dozen or so keys/key combinations which are unused in any other application for use as KM Triggers.

In particular, I do often type diacritics, top-bit set characters such as £ and ♭.

I thought that I could copy permanently these into KM clipboards; so that I can paste them with a single Trigger whenever I need to - thereby not having to enter the extra keystrokes to invoke the OS' Emoji and Symbols palette/popup.

I think I'm right in assuming that if in KM I make those keystrokes which might clash with existing assignments available only in certain applications by setting such a preference in KM Macro Group by Macro Group, I won't run into any conflicts.

But since there must be easily 20-25 such diacritics and other pasted strings/KM Actions which I want to be available throughout all applications and the Finder, the possibility of mapping to such a 'hyper key' as Caps Lock (as Karabiner seems to be able to do, am I right?) is an attractive one.

So my priorities would be:

  1. "first do no harm"
  2. make more keys with modifiers available across potentially many applications and the Finder.

Your suggestions and help appreciated :slight_smile:

1 Like

I am not an expert, can't even use terminal and I downloaded Karabiner with no problems. I only use it for changing the caps key to a "Hyper key". One use and that fully justifies the app for me.

Did you try to make typed triggers for those symbols? I am sure you can insert them into a text expansion using the 'paste text' or even 'type text' action and trigger with a string. I had a few logic symbols done that way at one time. Greek phi and psi, they worked fine: I am not sure if I had some 'style' issues though. I used 'xpi' for the trigger to give one example. I don't know whether every symbol on the OS palette can be properly inserted: I assume they can? You can also set 'paste text' to only fire after a space and that is useful, I assume I could have used "xp" in that case for phi. Whether that would be quicker than a modifier key + single letter is interesting. I found it so. I include a screen shot of one I still have on Keyboard Maestro, it gives me the prime symbol without having to fuss around. It seems analogous to your problem?

I am not sure either if you can combine a modifier key with a string to trigger text expansions, which is effectively what you are doing. You would only use them in contexts which accept text obviously.

Screen Shot 2019-08-27 at 18.02.04 PM.png

1 Like

For me it is pretty straightforward:

I will not use Karabiner (or any similarly low-level soft) unless I really feel the need to do so. An Hyperkey is certainly not a reason. If you run out of hotkeys, you should rethink your concept of how you are triggering your stuff.
As mentioned above, this is just my biased (of course) opinion, because I had 100% negative experience with Karabiner. YMMV. (No safety concerns though, but the soft was only for max. 7 days on my computer, so I can’t really tell about safety-relevant things either.)
And I’m not a “system-ultra-clean” guy, just a normal “system-clean-and-get-rid-of-any-app-that-has-“Clean”-in-its-name” guy.

I highly recommend to try Karabiner-Elements. You can always uninstall it.

If you just want to have easy access to some glyphs you use very often, then go Ukulele, as linked above. (Your standard US keyboard layout is full of glyphs you never use; just use that space!)
Most comfortable and most safe (since Ukelele just creates standard macOS keyboard layouts, no low-level or kext stuff involved). This is a no-brainer.

For string insertions go with LaunchBar, Typinator, or KM; in that order.
If you want corrections, or very fine-grained substitution options, then Typinator.


Of course, if you want to make your keyboard bahave like an omnipresent vim input-scheme, Karabiner is your only choice. Tap a modifier and your “j” works as it should.


PS:

And I like the Vi(m) input method more than I ever ever liked emacs or any macOS-adopted emacs shortcuts. But Karabiner is not the real thing (for that context). If it would come at no cost, then OK, but I doubt this is possible.

1 Like

Tudor,

Thanks so much for your thoughts!

Yes, that was exactly how I was thinking of using it. In fact, I (also) re-installed KeyCue, because that shows me all current/active mappings in any one application/the Finder; and I'm leaning towards making use of the remaining (unmapped) keys wherever and whenever I can instead of adding complexity.

I did, Yes. Although it was different from yours, and really is my next question :slight_smile:

My macros each use a hot key to trigger them (e.g. ctrl+Option+Cmnd+F for the flat symbol (music): ♭).

The macro's Action in each case then pastes the ascii character in question (e.g. that ♭) from a named clipboard.

Which means many clipboards; I suspect that's not considered best practice?

But for something like the flat (♭) there really is no other way of doing it - except, perhaps, I suppose 'f' with preceding and succeeding spaces!

Very much so, thank you. I'm just wary of creating and so naming multiple dedicated clipboards. Should I be?

This could be done more easily with something like TextExpander, of course. But I want to try and stick with KM :slight_smile:

1 Like

Tom,

All very helpful. Thanks!

Agreed. I accept your reasoning. Because - as you say:

Again, that was what I was thinking - especially application by single application. For system-wide triggers, I have begin a spreadsheet which will remind me of my more obscure combinations, until I have learnt them.

I looked at it after that post (thanks) and decided that having multiple keyboard layouts was (also) overkill.

I looked at Typinator again (would you recommend it over Text Expander?). Definitely comprehensive.

Maybe I'm mistaken in wanting to have as few apps overlapping as I can?

1 Like

Ever had a look on LaunchBar? It provides two crucial things:

  • Typed string trigger with auto-learning, and the auto-learning is really good, which is what makes the difference
  • Single-Modifier-Tap launchers for all major functions (search, snippets, send)

Many folks miss out on the second point: LB becomes really powerful only once you start launching its functions via Modifier Taps. (Of course, you could also press something like ⌥Space, but why should you? That you could also do with Alfred or KM.)

Calling my snippet via Ctrl<two letters> isn’t really much slower than typing <trigger char><two letters> in Typinator or KM.

I shortly explained it here:

But there are many other thraeds on this forum about LB vs KM vs Alfred vs whatnot.

Anyway, with LB I don’t have any hotkey problems at all. And if you are really into static things, you can still set a fixed abbreviation for anything.

You can switch keyboard layouts with one keystroke. The OS even has a special shortcut for that, previous or next. (See Shortcuts in Prefs)

Already long before Text Expander’s subscription price model I preferred Typinator. It was always hazzle-free and quick. IIRC, Text Expander always tended to have different issues, but don’t ask me what it was. Maybe others have better memory than me.

So, the change of Text Expander to the subscription price model was never an issue for me. They tried to promote their descending software to first level via subscription. This was only a thing for people who were engaged with Text Expander, because e.g. they had a huge library, or for people who thought Text Expander was the best (or even only) thing.

In normal-day-usage I don’t use either, since LB’s Ctrl-Tap to invoke my snippets is enough for me. Sometimes I have Typinator running when I’m on a text with many repeating terms. (I work as technical writer/editor, user manuals and such.) But that’s text-based.

For correction, the OS’s auto correction isn’t too bad, though sometimes aggravating. But compare it with MS-Word’s correction. Word, at least in German, is insisting on plain wrong things. It is ridiculous compared to Apple’s (still very improvable) auto-correction.
BTW, Typinator also comes with correction dictionaries, just in case.


No. I think this is a constant challenge that has been imposed on us. Comparable to finding the meaning of life, or such. Probably more important.

1 Like

Tom,

I did look at it when I decided that Alfred was more what I wanted.

But I can also see exactly why you recommend it in this case: those two distinct advantages.

Yes, I can see what you mean. I think - with arthritic fingers and especially thumbs - it's less a question of speed than true flexibility.

And trying to 'centralise' on as few apps as possible.

But I shall be taking another look for sure! Thanks.

Clear. I can also see the guts of ways to make KM expand text in your example.

That's also really crucial and distinguishes LB from the others.

Having been a Mac user for 30+ years, I've tended to stay away from apps - which LB seems to be: I may be totally wrong, please say if you think I am - which 'patch' the Finder… e.g. quick ways to launch Numbers (as in their introductory video).

Or am I seeing a problem where none exists?

== Ukelele ==

Which would mean that the workflow would require three (sets of) keypresses, wouldn't it:

  1. invoke the preferred/desired keyboard layout in Ukelele
  2. press the desired key
  3. return to the default keyboard layout

?

I can imagine; and suppose the only way to be sure is to try it. They too have a 30 day policy :slight_smile: .

Which would work for me in most applications, wouldn't it… Mail, TextEdit, BBEdit etc.

But again, one of the reasons I revived KM was to have every such tool in one place.

Thanks to you, I'm going to take a closer look at all these options, now!

I am pretty convinced that I shall soon be able to do everything I want to one way or another.

As always, much appreciated…

2 Likes

I don't see why you fetch from a named clipboard every time you enter a symbol? Why not just put it in a "paste text" action? If you can get it onto a clipboard you should be able to get it into a "paste text" action. If you use that, as in my example, I don't think you create a named clipboard. I have several like that and only one named clipboard I can find in my preferences for another macro altogether.

There is a LaTeX package which can do a lot of the symbols you use, I think probably renders into music notation. Here is an example of some of the markup used, I found it a lot more intuitive than some accounts suggest. You can't make mistakes though, LaTeX is unforgiving in a way most apps and tools are not any more. But the results are beautiful.

\documentclass[a4paper,12pt]{article}
\usepackage{wasysym}
\begin{document}
\eighthnote ~~~ \halfnote ~~~ \twonotes ~~~ \fullnote ~~~
\quarternote ~~~ $\natural$ ~~~ $\flat$ ~~~ $\sharp$
\end{document}

I don't always streamline things on KM. I don't have a big macro collection, in fact it is quite small, so it doesn't matter if I use a bit more data space than I really need.
Maybe I haven't quite understood your issue? I know some key combinations can feel akward under one's fingers.

I will also say I use the CONFLICT PALETTE if I need, I am not afraid of it; so the same keystrokes bring up a palette and, if you are careful, one further keystroke will pick out one of them quite easily and quickly: I think it is neglected aspect of Keyboard Maestro. Partly because it lacks a kind of neatness or elegance. I think it actually does and is a neat solution to the remembering keystrokes problem and other things. If you create a hyper key, as everyone calls it, you will be delighted I think; I really do.

I use KeyCue because it shows Keyboard Maestro shortcuts and is the main reason I use Keyboard Maestro for expansions, snippets whatever: I found TextExpander cumbersome as I could never learn or call up quickly the shortcuts. So great minds think alike there @MarkSealey !

I use LaTeX now and only need for my own private notes, or initial write ups, some of the symbols, I found formatting even with power tools was never as good as LaTeX. I am developing a series of Keyboard Maestro macros for it. I don't know but I wouldn't be surprised if the flat symbol was doable in LaTeX on some package. I couldn't see anything offhand but that means nothing.

In reference to what @Tom said, I would really consider Launch Bar but if you already have Alfred, well maybe that is enough as you say. I rely on it now.

1 Like

Going to bed right now, so just replying to one —hand-selected :cold_sweat: — question:

I expressed myself wrong. You don’t necessarily have to switch keyboards.

What I meant with

“Your standard US keyboard layout is full of glyphs you never use; just use that space!

is this:

The standard US layout

With down:

With down:


How many of these chars are you actually using?

I’m pretty sure you find space here for 20 or 25 of your custom characters without sacrificing the usability of the layout for every-day purposes. — Without even counting the endless possibilities with dead keys and multilevel dead keys…

All the characters you don’t need you can replace with Ukelele by the characters of your choice. You don’t have to touch the 26 letters or other chars that are important.

No need to switch the layout.

You only need to switch the layout if you would create a new layout full of custom characters (e.g. without any letters left). Sorry for the misunderstanding.

As mentioned in another post, I’m using my custom layout since years — in every-day context. This one. Have a look at it to get an idea what you can do.


Another misunderstanding, sorry.

Ukelele is a keyboard layout editor. You use it to create macOS keyboard layouts.
Once created, the layout is standalone. Like any other keyboard layout that ships with your OS, for example Spanish or French.

The keyboard layout is a document, used by the OS. You can edit or create that document with Ukelele. Once created, Ukelele is not required to use the layout. The OS uses it.

No third-party kext involved :wink:

4 Likes

Tudor,

Thanks. I'll do as you suggest. It was just my sense of tidiness - to have clipboards adapted to the different purposes!

If that's over-complicated it, I'll change it happily… in fact I'm still getting to grips with KM's multiple clipboards.

Why does KM make it possible to have more than one? When would you use (other) (named) clipboards, please?

Understood. Thanks. I also use MathType, which does too.

It's more a question of making things so that I'll actually use them; making them either easy to remember and/or being able to list them until I know them; making them accessible; and - ideally making them all originate in one place… like KM.

But you and Tom have kindly opened my eyes to other possibilities!

Yes. Good point. And then - you'd have to have 26 conflicts for a signal keypress, the distinguishing (second) letter, to make that fail.

Yes; I like that too.

So +1 for Typinator.

No; again you've kindly given very useful suggestions: I shall definitely look at it again - tomorrow!

As I say, my chief reservation is stability. If I am 100% sure it doesn't compromise any other part of an already highly complex OS, I can well believe it has its part to play too. Thanks again!

2 Likes

Thanks. I see. Got it.‌

I see. Yes! I can imagine there are enough for a good 20 Triggers, which would work very well.

So are you saying that I'd carefully build one new, all-encompassing Ukelele layout and use it with those dead keys mapped all the time, Tom? As a default? Just a more efficient and comprehensive one because I'd be mapping unused keys to, for instance, both KM Triggers and conceivably text expansions?

No problem!

No. My fault!

But if I did want to create and use another layout - albeit conventionally within the OS - then I would have to invoke Input Sources (menu bar etc); just as I would for, say, a Spanish layout, wouldn't I?

Which I like.

Thanks for making everything in this mix so clear now. Experiment time :slight_smile: I can't wait.

1 Like

You don’t have to use dead keys. I mentioned it just to illustrate that even if you run out of space, you can still map characters to dead keys, which can multiply the number of available characters by a factor of 10 or more.

This is also explained in my linked article, and you can try it out with the downloadable custom layout.

Yes. See the above mentioned custom layout. I think it contains all the necessary keys to qualify as default layout, no?

Nope. If you mean KM hotkey triggers, you can’t map them. Y (as hotkey) is always ⌥Y, no matter which character or symbol you have mapped to that key combo.

You could use your additional symbols as styped string triggers though. But this doesn’t make much sense.

And you can’t “map” text expansions. You can map the symbol ✘ to Y but you can’t map a sequence of characters/symbols to a key. For that you have Typinator, KM or Text Expander.

The point of a custom keyboard layout is to accommodate all the special glyphs that you often need and which otherwise only could be generated with the help of the OS’ Character Viewer palette or via text expansion software.

Let’s say, you often need the ♭ symbol. Then it likely is more comfortable to have it mapped to B than to have to trigger it by typing ;flat with your text expansion software.

Correct. But if you manage to map all your custom glyphs without unmapping other needed characters, then you’ll never have to switch.

I mentioned that because I thought you were thinking that you need Ukelele in order to switch layouts.

BTW, trying to create the perfect personal keyboard layout can be a very addicting endeavor :nerd_face: … that never ends…

1 Like

Tom,

Got it!

No, I meant that if, say V normally produces √, I could remap it using Ukelele to my email address. But I now see that that's text expansion, so No.

So I may be confusing the functions of Ukelele; and in fact they're separate from Hotkey allocation in KM?

I see. That is indeed my case. Obviously I need to go back and look at Ukelele again :slight_smile:

MarkSealey:

I see. Thanks. I know I can work that out beforehand: my Input Source > US Keyboard (default) currently has 30 favourites.

I see thanks. I did the first time we discussed it. I've looked more closely now. I like the fact that it's file, rather than patch/kext, driven :slight_smile:

I can easily believe that, Tom!

1 Like

If you have an extended keyboard with number pad, you can use Ukelele to create a layout which replicates the standard US keyboard (or whatever you use now), but makes additional characters available when typing the number pad keys with shift and/or option. That gives you a few dozen extra characters, doesn't require you to change your typing habits otherwise, and you never have to switch layouts. (Well, once, when you first set it up.)

1 Like

[Tom:] You don’t have to use dead keys. I mentioned it just to illustrate that even if you run out of space, you can still map characters to dead keys, which can multiply the number of available characters by a factor of 10 or more.

Got it!

Oh, I now see a possible source for a misunderstanding here: With “dead keys” I don’t mean ‘unused keys’. I’m referring to the fix term.

So I may be confusing the functions of Ukelele; and in fact they're separate from Hotkey allocation in KM?

The only (really only) function of Ukelele is creating/editing keyboard layouts.

So, yes, the two things you mention are not related at all.

Not even the actual mapping of your keyboard layout is relevant to KM’s hotkeys:

Example:

Key Code 33 is mapped like this on two different standard macOS layouts:

That is: Key code 33 gives you “[” with the US layout and “ü” with the German layout.

Now I set this hotkey as macro trigger:

09-pty-fs8

It works.

Now I switch my keyboard layout to German…

19-pty-fs8

…and press the same physical hotkey, which is mapped to “Ü” in the German layout: It still works. (I do not have to press ⌥5, which is where “[” is mapped to on the German layout.) [1]

And when I reselect the macro in KM, I see that the trigger field has automagically changed to reflect the actual mapping of my current keyboard layout:

09-pty-fs8

[Tom:] Let’s say, you often need the ♭ symbol. Then it likely is more comfortable to have it mapped to B than to have to trigger it by typing ;flat with your text expansion software.

I see. That is indeed my case. Obviously I need to go back and look at Ukelele again :slight_smile:

As said, with my article I tried to explain the basics of keyboard layouts and give a showcase of a custom layout, including advanced things like dead keys and multilevel (chained) dead keys. If my English there is too crappy, then download Ukelele and start reading the tutorial :wink:

my Input Source > US Keyboard (default) currently has 30 favourites.

You mean, you have 30 layouts in this menu!?:

16-pty-fs8

Why?



  1. I think it is worth to mention that this is different from the standard/system behavior: In other apps, if I switch from US to German layout I can no longer use Z for undoing. I have to press physically Y. (Which is where the “Z” is mapped to on the German layout.) KM is smarter :slight_smile: ↩︎

1 Like

Well, usually you have more than enough space also with a non-extended keyboard. But this is a great tip. It gives you at least 30 additonal chars without even tinkering with the non-number-pad section of your keyboard.


PS:

I didn’t have an extended keyboard for the last 10 or 15 years, so I completely forgot about that.

Thanks, Eurobubba - I do… Late 2015 iMac.

A 'few dozen' would do it, I know for sure.

Shall definitely investigate that today!

Tom,

Now I see. Thanks. Dead keys don't do anything by themselves :slight_smile:

My apologies. Clearer and clearer…

No. I can see what not.

I guess I'm actually looking at two questions in all this:

  1. how to manage action/change (expansion, insertion, launch etc) by Triggers, and
  2. how to manage text manipulation (largely text expansion) by utilities like Typinator

My hope was that KM could do both/all of that - just for simplicity's sake.

Now I doubt that it can.

And I was also trying to tie keyboard mapping in general to both of those questions; I suspect it has a marginal role to play only in 1.

Does that seem right to you?

Your example of Key code 33 (left bracket vs u umlaut - depending on Layout) makes it crystal clear.

Achieving that difference in result via Ukelele has nothing to do with what happens when I press Cmnd [; and - further - how KM treats the key combination… it doesn't care about the Layout in operation at the time, does it - and you re-inforce that by your [^] footnote.

It isn't at all. And I shall! Thanks :slight_smile:

my Input Source > US Keyboard (default) currently has 30 favourites.
You mean, you have 30 layouts in this menu!?:

No. In US I have 30 key-combinations which I use often enough to count as favourites.

I'm also looking at PopChar:slight_smile:

1 Like

I guess I'm actually looking at two questions in all this:

how to manage action/change (expansion, insertion, launch etc) by Triggers, and
how to manage text manipulation (largely text expansion) by utilities like Typinator
My hope was that KM could do both/all of that - just for simplicity's sake.

Not entirely sure if I’m grasping correctly what you mean in paragraph 2, but KM can do all that.

It’s just – as always – a question of the right tool for the right job:

If you don’t have many text expansions (you’re entering your custom glyphs already via your brand-new custom layout, created with Ukelele, right?), I can see that KM’s text expansion facilities are enough to do any remaining job.

Well, if not, you can still take Typinator into the game. It will do the same as KM’s expansions, but offers a much more fine-grained interface (settings, default-trigger chars, attribution to apps, etc.), also more comfortable, and other useful or fancy stuff.

And, BTW, Typinator (or Text Expander) also is just an app, so no additional kext here.

And I was also trying to tie keyboard mapping in general to both of those questions

As said, keyboard mapping (= keyboard layouts) have nothing to do with KM or any text expansion app.

Unless you are speaking of modifier key re-mapping. This is an entirely different history, and will indeed throw you back to Karabiner or similar kexts.

Standard OS layouts (as well as the ones you create with Ukelele) are not “touching” (manipulating) modifier keys. They are just obeying when any modifier is pressed, according to the layout.

If my English there is too crappy, then download Ukelele and start reading the tutorial :wink:

It isn't at all.

Once you have read the article and maybe tried out the custom layout, let me know about any open questions. Always happy to answer them.

No. In US I have 30 key-combinations which I use often enough to count as favourites.

Got it now, thanks.

I'm also looking at PopChar… :slight_smile:

Highly recommended from my part. Could live without it, but it is really neat and I don’t want to miss it. It is the OS’ Character Viewer on steroids. And, yes, from the same Austrian quality developer like Typinator :wink:

1 Like

When I am sure it is safe, I will post up a Macro that has another way of getting different results from one key stroke. It is quite complicated to explain and timing matters, if you keep holding it down it gives differen results depending on when you lift your finger. I will post it in a new topic, when I am sure it won't do any harm, it uses 'if then' flow control and those can get into loops of some kind and freeze stuff, I never had one do any real harm, but once or twice I had to restart and so on...

@MarkSealey Great, nice to chat too a bit round a topic: I think one learns often that way. I don't know about named clipboards: I have never used one knowingly, there is one I think put on my own Keyboard Maestro by a macro I just imported from here, I think it grabs an URL. However I don't think named clipboards are in any way I can think of 'tidier' in principle? I can see how it looks that way. It is always hard to judge these things without being able to go far 'under the hood' and appearances here can be deceptive?

https://wiki.keyboardmaestro.com/Clipboards

Tells you stuff you need, especially that 'Default Clipboard' is NOT the system clipboard. I try, to be honest, to stick as much as I can to the System Clipboard. You can use the Clipboard Switcher and get to the last 200 items on it, also 'pin' stuff there which is not automatically deleted. Launchbar keeps a history of the same clipboard and I use that too: I find adding named clipboards too confusing since some of my macros are very baroque as it is. I haven't really made neatness a priority. I will reach that point one day I guess? Keyboard Maestro often works because you can sort of join up different parts of it and get them to work together indirectly.

I will say that I find and found the Keyboard Maestro Wiki useful but especially I found David Sparks' field guide on Keyboard Maestro really upped my own game. Incidentally at times the screencasts show you tricky things that are hard to get from the forums or wiki. I only started after years of Keyboard Maestro use ot use the clipboard switcher after seeing what David could do with it. It is a $29 field guide but really, I think worth it, I guarantee you will find stuff there you didn't know. 100% sure :smiley:

Really, like I say, I just paste or type from the 'insert text' actions. I think that is really the best way to do it from a typed string.