How to quickly add and remove input language in windows? - keyboard

I have 2 keyboard layouts (English and Russian), which I normally use, but sometimes I need to type something in Czech. And I need to open settings-language and input-choose Czech language and then choose the QWERTY type of keyboard every time (because there is QWERTZ layout by default). And I hate when I leave Czech language and it pops up every time I want to switch to English. So is there a way to create a button which will quickly add an input language when I need to use and remove it when I don't need it anymore?
I've found something like that on Autohotkey forum here, but the script doesn't remove an input language completely, it just uses a certain shortcut to switch between chosen languages.

Not exactly answering your question, but this might help:
I developed for myself ahk (ahk v2) script for inputting czech characters by Win + 1-9 number combinations (correspoding keys on czech keyboard). You don't have to switch to czech layout if you just want to type a few czech characters...
#SC003::Send "ě"
+#SC003::Send "Ě"
#SC004::Send "š"
+#SC004::Send "Š"
#SC005::Send "č"
+#SC005::Send "Č"
#SC006::Send "ř"
+#SC006::Send "Ř"
#SC007::Send "ž"
+#SC007::Send "Ž"
#SC008::Send "ý"
+#SC008::Send "Ý"
#SC009::Send "á"
+#SC009::Send "Á"
#SC00A::Send "í"
+#SC00A::Send "Í"
#SC00b::Send "é"
+#SC00b::Send "É"
#SC01A::Send "ú"
+#SC01A::Send "Ú"
#SC027::Send "ů"
You get these SC key codes by putting
#InstallKeybdHook ;
in any of your ahk scripts. See https://lexikos.github.io/v2/docs/KeyList.htm#SpecialKeys for explanation.
Due to the problems with encodings it is also probably necessary to save the script as UTF-8 with BOM.

Related

Use of underscore _ in strings translations

I believe that it is used to determine which keyboards shortcut will be used and in this example underscore defines that (even though I'm not 100% positive about that).
Let's say there is a string on weblate like this:
make all _uppercase
Does that mean that there will be e.g. ctrl+u keyboard shortcut for this command or some defined key + u?
If that's correct, I have following question, what should be done if for some reason there is no "u" letter in corresponding translated phrase?
Should it be translated without using underscore?
I've seen use of something like (_u) after translated sentence,
"corresponding phrase in other language (_u)"
Is it ok to do it like that?

How to find which key is pressed, not which character it will be?

I need to find out which key was pressed, not what character it would be.
For example, I want after pressing 'a' a number such (1) create so I can map it to other languages. In common way we can find it is 'a' or we can have it's hash code, but is it possible to have char or hash code in a language and find out what char or hash code it would be in another language?
Attention some language have not the standard keyboard so pressing a key not mean a certain character.
There's no reason to do this in any language i've seen.
(besides the fact that you didn't specify in which language you are trying to achieve this)
All languages allow you to get the character code from a keypress.
If you know which encoding was used (UTF 8, Ascii, you name it), it's trivial to map the code to the actual character.
Assigning a different keyboard layout on OS level means that it no longer matters which keyboard layout you are using.
if you have a QWERTY keyboard, switch it to AZERTY and press the button where the q would be, you get an a, despite the letters on the keyboard still saying QWERTY.
If you are using a chinese keyboard, the characters no longer map to any western set, so the character codes will not match up with UTF8 or ASCII, but CP963 (or another chinese codepage, depending on several factors), which is so different there is no real way to translate it to UTF8 or ASCII.

Arabic: how to conveniently enter dagger-vowels (AKA miniature vowels) and alif-wasla with PC keyboard

I would like to enter dagger-alif, dagger-waw, and dagger-ya
(AKA miniature alif, miniature wow, and miniature ya) as well
as alif-wasla with a PC Arabic keyboard. These marks are used
to help the reader with pronounciation.
The dagger/miniature vowels typically appear over letters in textbooks
and dictionaries to show that a LONG vowel must be pronounced after
a consonant even though such long vowel does not appear after the consonant.
The miniature vowel is omitted from regular script such as in newspapers.
For example the word هٰذَا here appears with a miniature-alif over the
letter ه (and a fatha over the letter ذ) despite in regular script
the same word would be simply written as هذا.
The alif-wasla has a small mim in its initial position over the alif
indicating that the alif is silent and looks as follows: ٱ.
(this must not be confused with alif-madda which indicates
that a hamza followed by a long aa is to be pronounced and
is written with a tilda over an alif as follows: آ).
A picture of the IBM PC arabic keyboard layout can be found here:
http://en.wikipedia.org/wiki/Arabic_keyboard . The following
is a picture of a PC keyboard from DELL which was more or less
the Arabic PC keyboard I could find on the market to also display
arabic language symbols corresponding to shift pressed:
As you can see the sought diacritics are missing from the keyboard inputs.
These symbols are also partially described here:
http://en.wikipedia.org/wiki/Arabic_diacritics
The following link
http://www.fileformat.info/info/unicode/char/671/index.htm
shows that I can type alif-wasla as ALT01649 and
http://www.fileformat.info/info/unicode/char/0670/index.htm
shows that I can for instance type the miniature superscript aliph as ALT01648
but this only seems to work in MS Word.
But I cannot find a way to type these in LibreOffice. If anyone know
of some convenient manner of entering these other than cut and paste, which is what I
used above, then please let me know. Can I use for instance MSKLC or is there some
way of entering the missing symbols with Unicode shortcuts? Thanks.
The daggar alif is part of the Arabic typesetting font symbols. That's a free font which is you can find downloadable. Then you type the letter you want... for example the ha of haadhaa , set the cursor on that letter, and use INSERT.. SYMBOL and you will find that alif with other diacritics --- here's an example.
هٰذا
Peace
Yes, its not available on keyboard on Windows or Mac. It's a symbol to be inserted. If not on MS Word, other quick way is to google using the simple word and copy past the rich text result. HTH.
Update: On Mac, its available by using Alt + H in Arabic keyboard mode
Not all characters are accessible by keyboards (by default). To be able to insert special character conveniently from your keyboard you need to create a custom keyboard layout. Assuming you're on windows, use The Microsoft Keyboard Layout Creator.
In LibreOffice (and Microsoft Word), you can type the Unicode code first then press Alt+X to transform it into the actual character/glyph etc.
For example, writing هٰذَا would be writing ه then typing the superscript alef Unicode code 0670 then press Alt+X and it will become هٰ then type the rest ذَا.
You can just google the unicode code for certain characters, search here or see the full Arabic characters chart from the official PDF.
Ref:
Unicode Input on Wikipedia
Unicode charts

What alternatives are there for easier access to {, [, \ in non-US keyboard mappings?

All my life as a developer I was annoyed that on german keyboards some common programming characters are mapped to very awkward combinations:
[ = AltGr + 8
] = AltGr + 9
{ = AltGr + 7
} = AltGr + 0
\ = AltGr + ß
As I'm touch typing with 10 fingers, I regularly have to leave the standard finger position to type the above characters. While I've somehow got used to it, it still makes me shiver whenever I have to type lengthy combinations of the above symbols.
There are suggestions to use US keyboard layout instead but this again makes it very hard to type the umlauts äöüÄÖÜß.
So i wonder: What smart solutions have other non-english developers come up with to avoid these awkward shortcuts?
I'm primarily interested in workarounds for Windows. But as a vim user I'd also like to hear vim-only solutions.
Not an actual workaround, but an alternative solution that works well for me: use the US keyboard layout for programming.
Vim's choice of keys is closely related to the US keyboard layout. On a US keyboard,
/ is to ? (Shift/) what n is to N;
/ is extremely convenient to reach, and unshifted;
{ and } are in the same place as [ and ], they differ only in shifting;
+ "line down" and - "line up" are adjacent;
: is on the home row;
< and > are neighbours;
all characters commonly used in programming are accessible with Shift, there is never any need for AltGr or CtrlShift etc. combos.
The last point is especially important. Vim's command language is about eliminating modifier keys so having to use only the Shift modifier is good.
At some point I realized how my keyboard layout held me back. I switched to the US keyboard layout for programming only. I have been doing all my programming and terminal hacking in the past few years on a US layout and I'm very happy with it. Whenever I need to write an email or make notes I can just switch back. The keyboard layout is like a representation of the mindset I'm currently in: US for programming, native for other things.
I say, give it a try.
Not only for that reason, but because of the better layout, I learned the dvorak for programmers layout. I don't recommend you to learn the whole layout - it took me monthes to reach my old qwertz-speed.
But the sticking point why this layout is explicitly recommended for programmers is the alignment of the numbers-row. The numbers are in shift-position whereas the symbols are in first position (but in a better alignment as in standard-qwertz and even qwerty). So for example if I hit the qwertz-5 I get ( instead, 8 is ) and so on.
Here you can see the whole layout.
You also have to leave the "normal" keys and reach the numbers-row, but if you train it a bit, it feels really awesome inside vim and while programming.
So one option is to customize your standard-qwertz layout (maybe using the Microsoft Keyboard Layout Creator or any other tool) to get the special keys better positioned, like for example in the dvorak for programmers layout.
Another option is using qwerty and remapping the german umlauts to AltGr+a for ä, AltGr+s for ß and so on. That's what I also did with dvorak.
It's not that handy as on standard qwertz, but those characters don't occure that often, I think.

What is the most convincing command in Vim

I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old.
All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Graham is a Vi dude.
. (dot) - repeats the last editing action. Really handy when you need to perform a few similar edits.
:help usr_12.txt
That'll bring up a section in the help system that discusses "Clever Tricks". If those don't get you excited I don't know what will!
Recording macros
The asterisk.
*
Its effect: Immediately search for the next instance of the word under the cursor.
The best thing is the efficiency with which you can edit code (which is done a lot in programming). The commands such as
cw to change a word
dw to delete a word
ct, to change all text until the next comma
ci( to change the contents of the parentheses you're currently in
xp to correct spelling mistakes ("spleling" -> cursor on l -> xp -> "spelling")
o to insert a new line below and start editing
O to insert a new line above
Then there is the possibility to work with named registers very quickly. To move a block, just select it, press d, then move to it's new location and press p. Much faster than Ctrl-C and Ctrl-V. Use "ud to delete text and move it to register u (I use this one for the commenting template).
And also Vim has all the scripting support you need (either using it's native scripting language or using Python, Ruby, ...)
the numbers.
in command mode
type a number ( any number of digits )
type a command.
that command will be executed $number times
ie:
99dd
erases the next 99 lines.
The fast startup time.
The sharp distinction between editing and viewing. (you know when you edit)
The only way you ever find what you are looking for is with search "/" and that is good, since it much faster than your eyes.
But the best command(s) are:
/ - search string
ZZ - quit
. - repeat last insert (I think)
%! - insert unix command
Handling multi line regexps in search strings with "\_.". While checking over 4GB text files of various formats, it had saved my life several times.
Why are you looking to be convinced to start using a different editor? If you're happy with what you have now, stick. If not, perhaps ask about editors with features that you lack.
Even if you are using Visual Studio there is the wonderful vsvim.
I love the speed of Vim but I find it lacks the features of a modern IDE for C++ development. Eclipse CDT with the viPlugin is a good compromise.
You get the power and source overview provided by Eclipse CDT with the speed and flexibility of Vim for coding.
The lovely built in regular expression evaluator.
Maybe reading "Come home to vim" by Steve Losh article is a good start, or
a series of videos about interesting plugins. And be sure to see some articles on the site vimcasts.org
You should map Caps Lock to Esc. It will make getting out of insert mode feel natural as opposed to the awkward move you must make to press the ESC key. Besides, who uses Caps Lock anyway?
\v
Make your regular expressions mostly Perl compatible.
See very magic section here for more information.
To be truly inspired, you must see a vim guru in action. If you do not have a local guru, here is a video to inspire you.
http://www.youtube.com/watch?v=jDWBJOXs_iI&feature=related
If you don't already know vim, the speed at which code is navigated, sliced, and diced will be indistinguishable from magic. After a few months of studying vim, the same editing speed will seem commonplace.

Resources