Can I replace Tab key as the trigger key in autokey? - linux

I have recently started using Autokey on a Raspberry Pi. I have it installed and operating as expected. The one issue I have encountered for which I cannot find a solution is that I would like to use the backtick key to trigger text expansion.
I have used back tick key previously with other text expansion/hotkey utilities (namely I used it with AutoHotkey on a Windows machine for years). I prefer to have a trigger key to avoid any unexpected triggers. I am so used to using the backtick key that I hit it instead of Tab. I chose the back tick key a decade or more ago for this purpose because I seldom use it (whereas Tab I use constantly). That muscle memory is a hard thing to go against.
I cannot find this discussed anywhere in the documentation and had no luck searching for an answer around the webs. I dug around in the Autokey program files, but didn't find anything so far. Seems like choosing a custom trigger key should be doable.

I haven't been able to solve this in the way I mentioned in my question (setting the backtick key as the trigger rather than the Tab key). I have however come up with a simple work around.
In all of my abbreviations I include the backtick as the last character. Doing this in combination with using the 'trigger immediately (don't require a trigger character)' accomplishes what I was seeking to do.
I am still interested to hear if anyone knows how to do this more directly (changing a setting, rewriting part of the program, etc.).

AutoKey has an option to trigger expansions on all non-word characters. The problem is that it does not consider the backtick a non-word character. To change that, you would have to edit the source code and add the backtick to that list.
I'm not sure where that is in the source code, but if you ask on our Gitter page https://gitter.im/autokey/autokey , one of our developers or advanced users may be able to help you.
This still isn't exactly what you want, but it's closer.
You could also replace the tab key with the backtick key in the source code, but that sounds a bit more dicey and might have other side effects.

Related

Windows 10: reset keyboard layouts possible?

Solved, see below!
Is there a way to reset keyboard layouts in general in Windows 10?
I messed up using Microsoft Keyboard Layout Creator some time ago, and I'm not able to fix it.
This is NOT something that can be fixed through anything in Language preferences, btw.
Last year, I was stupid enough to try to fix my keyboards on a "lower level".
I use the Norwegian and Korean keyboard a lot, sometimes also Japanese and Canadian French.
I have a hard time using symbols, like ";" - "'" - "~" etc, since these are placed differently on the various keyboards.
I looked for a solution, and found "Microsoft Keyboard Layout Creator". I tried to fix the keyboards, but it didn't work that well since it had problems with the Korean keyboard. I thus tried to change the Norwegian keyboard somewhat, so that I would be able to write more efficiently, without always checking what keyboard I was using (the Korean one also has the American one ingrained, with a simple push of Alt-Gr).
I also have tried to make a shortcut to go from Norwegian to Korean and back seamlessly, without scrolling through other keyboards as well (Win+Shift scrolls through all available ones).
I don't remember exactly what I did, but it didn't really work out, so I thought I deleted the customized keyboards, and went back to the regular ones.
But there was a problem: one of the keys, VK_OEM_3, the one to the left of "L" to be exact, (";" on a regular US kezboard) no longer worked in Norwegian when used in a regular way. At first, it changed keyboard every time I used it to write regularly. I had set it up to do this when pushed WITH another key (probably AltGr), but something was not right.
I managed to delete the customized keyboards, deleted and reinstalled the Norwegian keyboard from Microsoft, but lo and behold, the key no longer worked. I.e, it works when I push it down for a long time, maybe half a second, and then I get a lot of "øøøø". When using TeamViewer, it dosn't even help to hold the key in for a long time. And the digital keyboard certainly does not work.
I have tried to download other keyboards, and the key works well for A-Z and symbols that exist on a US keyboard.
Thus, the French keyboard, where it is an "M", works well. As does US and Korean keyboard layouts where it is an ";".
But it works as badly for Danish layout, where it is an "Æ" or German layout, where it is an "Ö". Both of these layouts were downloaded for the first time after I had messed up.
I have tried kbdEdit, that made me end up with a German keyboard layout I had a hard time to get rid of, even though I deleted it multiple times from "Langauge preferences".
I haven't learned kbdEdit well though, so it might work out.
But I'm afraid that it might not work, and that I
But what has happened here? I used a Microsoft program, and thought that would be safe enough, even though I was warned it might not work, since it's old. But messing up one key completely...
I have deleted all the new keyboards from the Registry (HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layouts), btw. But it's apparently on a lower level than this, since there are problems with all kinds of keyboards that have "extended Latin" letters on that place.)
What I wonder, is if there is a file that can be replaced with a standard file. I don't really want to reinstall Windows and my hundreds of programs, but I can hardly work in Norwegian the way things are now.
I have to check the phrases for eventual missing "ø", and when I remember the problem, it stops my flow since I have to push down for a long time and then delete the extra "øøø"s.
I finally managed to fix the problem:
Under registry keys, in my case in multiple locations, there is a map called SYSTEM\KeyboardLayout\Substitutes.
I deleted everything but the default one in all of these, and now it works!

Creating a floating menu that pops like normal menu but appears at mouse position

Some context
I've recently switched to ubuntu budgie (from unity), and I am really tired of the Plank/panel menu combo. I cannot find a setting that suits me, because depending on my screen setup, there's always something in the wrong place.
I am literally unable to show the menu on certain edges if I activate auto-hide, and if I don't activate it, it's not nice at all, to the point that I have removed the plank thing altogether. (Am I having strange bugs on this OS, or is it really messy?)
My idea
With great frustrations come new ideas. I thought again about one I had in the past. I would like to have a circle menu that pops around my mouse cursor when I press a given key combination (very much the kind of thing you would find in some games).
The main use case is to get "pined" application shortcuts easily when I need them, but perhaps other things would fit well with them (commands ...).
Questions
So my questions are:
Does such a thing already exist?
If it doesn't, is it difficult to realize? (How much time, complexity, ...)
What tools/libraries are needed for such a project? I know I'll find plenty of explanations on the gnome developer website but I could really use some more help.
Since you mention a buggy behaviour on Plank, depending on the screen configuration, I suspect you are suffering from this bug. In short: Plank's returned values for the space it needs are not always correct in multi monitor setup.
A neat option to replace at least part of the functionality is Ulauncher, by default called from a shortcut, but you could trigger it from anything that is capable of running its command.
Since Ulauncher's window simply identifies in the window list, you can easily write a script to move it to the current mouse position.
In case you'd need any help in that, just leave a comment.
Not sure if you are also referring to quick access of the window list, but for that you could use the Window Previews applet, or even the Workspace Overview applet, so life without Plank is possible.

Creating your own LaTeX keyboard layout : 1 key = multiple caracters

I've been looking for the answer for quite some time now. This is a project I have but I can't manage to find a way to do it. The main idea would be to plug an additional keyboard on my computer that write multiple letters by hitting only one key. For example, instead of writing down a (when I hit the a key), it would write \textbf{ (for example).
I already manage to find the keyboard layout file under Linux and to switch the a and b keys, but I cannot find a way to print multiple characters.
I know it exist editors (like Texmaker or Kile) that have auto-completion, but I'm most of the time working in project in groups and therefore we use writelatex.com which does not propose auto-completion in it's free user pack ! Besides, I'm doing that for my personal interest.
Thanks a lot.
Have a look at autokey. It can assign phrases to hotkeys. It requires X11.
Another option might be to use a powerful text editor like vim or emacs which both have features like this, and then copy/paste the text into writelatex.com.
Some browsers have add-ons that allow you to edit the contents of a text field on a web page with a chosen text editor.
Edit: In Xorg you can use the X KeyBoard extension to e.g. change the meaning of individual keys. While you can configure the keyboard to generate (multibyte) unicode characters, you cannot assign arbitraty character strings to one key, to the best of my knowledge.

Vim Autocomplete Hints for Go

I use https://github.com/nsf/gocode in conjunction with https://github.com/Shougo/neocomplete.vim for my Go autocompletion.
It works really well, except for one little thing. When I type something like
fmt.pri
I get autocomplete option like so:
fmt.Println(a ...interface{}) (n int, err error)
Since I'm new to Go, this is super helpful, because now I know what arguments the method takes, what are the types, and also what does it return.
Unfortunately, as soon as I write past bracket, the information is gone.
fmt.Println(
So on more complex methods that I'm using for first time, I'm stuck, and have to jump to source definition, or run godoc.
It would be much easier to have that information available somewhere, preferably on the bottom of Vim where the command/status line is.
Does anyone know how such a thing could be achieved?
Preview window breaks my Vim so it's not an option.
I use autocomplpop (well, my fork of it) and it has a feature where it does a small split window with the completion text in it that sticks around. It does this when you set...
let g:acp_completeoptPreview = 1
I'm sure neocomplcache has a similar feature. Glancing through its documentation it discusses a preview window in several places. Search for preview in its docs and see what you can find.
This is ultimately controlled by 'completeopt' containing 'preview' (:h completeopt). The auto-completing packages often set these values as part of their functionality, which is why with autocomplpop you need to use its option to control it instead of just doing 'completeopt+=preview'.

vsvim when input shift+each letter in insert mode, it add a '\n' automatically

I use vsvim and when I input 'shift+each letter' for a capital letter in the insert mode, it add a '\n' automatically. It puzzles me. Why does this happen and how can I avoid this?
Based on your comments you have the Python Intellisense Enhancer extension installed. This extension has a known bug that conflicts with VsVim (and really any other extension which uses the key mappings they have hard coded).
Essentially they are hard coding certain key combinations as starting intellisense. Visual Studio itself though uses commands which are mapped to certain key combinations. They are invoking intellisense by sending key strokes to the process instead of using a command or the intellisense API. This causes VsVim, and other extensions, to see the key stroke instead of the command and hence they react as if the user had typed it
I filed a bug on them with a suggested work around some time ago but haven't gotten any response
https://pyint.codeplex.com/workitem/1619

Resources