Additional Symbols using key combinations - keyboard

I am german but switched to US layout for coding. I got myself new keycaps and will stay with them forever.
Still, sometimes i wish to enter german symbols. Ä,Ö,Ü being examples thereof.
I know there is the option to Switch layouts (Super Space) for entering one character or compose key.
But I'd prefer to be able to use just a combination i can specify by myself.
I have an "Alt Gr" Key right of my spacebar. I could imagine using it + some key to get another symbol. Alt Gr + U = Ü for example.
Like this, i could also add other symbols i need from time to time, especially mathematical symbols or greek letters.
Is there any tool that can do this? Best would be one that is available for Windows and Linux.
Many thanks in advance.

Related

" button instead of < in my external keyboard

Recent weeks I was using my keyboard with Turkish language.
I would like to write " when I clicked the top left button, under the escape key. I don't want to write < character.
How to solve it?
You would have to have a way of changing the keyboard bindings. This might be possible depending ont he manufacturer.
Other options would be to create a short cut for the symbol you want. There are three double quoates I know of and if this is for coding you will want to make sure to pick the right one. But say you want the straight double quotes, then you can create a short cut that writes out the symbol.
Alternatively you can you can use the Alt codes tp produce it. Like Alt 0148 for "
I have solved the problem. I changed my keyboard type without knowing it. So corrected it on System Preferences -> Keyboard -> Change Keyboard Type.

When you press right arrow in terminal during a process "^[[C" shows up. What it means anyway?

If you happen to press arrows in Linux terminal while running a mysql query or inside a window where you have a server running a series of characters pop up. The same thing happens if you press the arrows + SHIFT or F2, F3, F4, etc. But if you press other keys they will show up as you would expect.
It is obvious to me that these sequence of characters were created following certain order. So what are they? What do they represent? Who came up with them ? Which computer language do they come from? They look archaic and useless...Should we drop them in the future? Or are they really useful?
4 Arrows
^[[A^[[B^[[C^[[D
SHIFT + Arrows
[[1;2A^[[1;2B^[[1;2C^[[1;2D
F2-F6
^[OQ^[OR^[OS^[[15~^[[17~
I searched for an answer to my questions on the web to no avail.
Actually, that is from a terminal emulator. The Linux console produces different characters.
In either case, those are generally referred to as ANSI escape sequences, which are sent by special keys (function-keys or cursor-keys), usually in the same type of "archaic" form which applications use to control the terminal.
The particular set you have quoted are documented in XTerm Control Sequences, and are recognized by terminal applications such as ncurses. The corresponding information in ncurses is stored in its terminal database, e.g., this entry (you may have to follow a few links to see all of this).
With that, you may have enough keywords to use with web-searches.

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.

AutoHotkey diacrictics mappings not working correctly with Vim

I've been using some mappings in Vim to avoid having to switch keyboard layouts to type in diacritics in my language (Croatian). However, now I wanted to move these mappings "up" so that they're available globally. I tried using AutoHotkey for this. Here are the mappings I wrote
#CommentFlag //
!;::Send {U+010D} // č
!'::Send {U+0107} // ć
!]::Send {U+0111} // đ
![::Send {U+0161} // š
!\::Send {U+017E} // ž
These work great in every application I've tried (browsers, notepad, MS Word), but don't work in Vim, which is pretty annoying as I do most of my typing there. More specifically, only 'š' and 'ž' work as expected, while both Alt-; and Alt-' give me a 'c' (instead of 'č' and 'ć'), and Alt-] gives a 'd' (instead of a 'đ').
I'm using AutoHotkey_L (though I had the same results with the "regular" AHK), Vim 7.3 (trying this in gVim; it doesn't work in the terminal version either (in a slightly different way) but I don't really care about that) on Win8.
I can give more info on the Vim version, but it's basically one of those windows binaries from vim.org. Things I guess might be important is that it has +multi_byte, and I've been using Unicode in it with no problems whatsoever.
Update:
As per Ingo's suggestion below, I've tried using IfWinNotActive to not have the mappings present in Vim and continue to use my old ones there. Here's one example I've tried
SetTitleMatchMode 2
IfWinNotActive GVIM
{
#CommentFlag //
!;::Send {U+010D} // č
!'::Send {U+0107} // ć
!]::Send {U+0111} // đ
![::Send {U+0161} // š
!\::Send {U+017E} // ž
}
I've also tried many other variations with the Vim window class (using ahk_class), with #IfWindowNotActive etc., but to no avail... The mappings are still there in Vim. Btw, the window title always contains the string "GVIM", and AHK sees that as I've confirmed with WinGetTitle.
I don't have a solution, but a workaround: When I faced with the same issue, I decided to emulate Vim's digraphs globally (also using AutoHotkey), and just except Vim (and applications like Remote Desktop) from that feature (so that the full range can still be used there; my script only supports a subset). You can find my implementation here.
You can also edit a keyboard layout itself, using Microsoft Keyboard Layout Creator.
For example, the English one that you use: choose combination of some character and some function key (Ctrl or Right-Alt, with or without Shift − e.g. for Caps).
Here’s how it looks:
I find the Apple International US layout very good for this purpose, having all the accents available using dead keys, so I've implemented it with Microsoft Keyboard Layout creator like stansult suggested.
Then I came up with the problem of having only one "Alt" key usable, so I ended up remapping my Windows and Alt keys using ScanCodemap. This is a viable solution if you don't use the Windows key that often. One caveat of this method is, that you'll have to use Win+Tab instead of Alt+Tab from now on to switch between windows, it takes a couple of days to get used to that.
Windows Registry Editor Version 5.00
; 0x003a001d: Caps Lock (0x3a) -> Left Ctrl (0x1d)
; 0x0038e038: Left Alt (0xe05c) -> Right Alt (0x38)
; 0xe05b0038: Left Windows (0xe05b) -> Left Alt (0x38)
; 0xe05c0038: Right Windows (0xe05c) -> Left Alt (0x38)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,05,00,00,00,1d,00,3a,00,38,e0,38,00,38,00,5b,e0,38,00,5c,e0,00,00,00,00

How to write superscript / upper index in Visual Studio?

It is possible, but I don't know how is it done.
Use the Windows Charmap.exe applet. In the Font combobox select a font that has a lot of glyphs, Arial Unicode MS is a very good choice. Tick the Advanced view checkbox and type "super" in the Search box. The grid will show all superscript glyphs, select and copy from that and paste into your source code.
Or copy/paste one of these: ¹²³⁴⁵⁶⁷⁸⁹⁰
Subscript characters: ₀₁₂₃₄₅₆₇₈₉
Adding more details to complement #HansPassant's answer. Other frequently used sets which can be used as is by copy/paste:
Superscript small case letters: ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻ
Subscript small case letters: ₐ ₑ ₕ ᵢ ⱼ ₖ ₗ ₘ ₙ ₒ ₚ ᵣ ₛ ₜ ᵤ ᵥ ₓ
If you're wondering why few letters are missing in above series then please read below posts:
Where are the other letters in this Unicode block?
Why does the unicode Superscripts and Subscripts block not contain simple sequences of all letters?
Why is there no character for "superscript q" in Unicode?
Since there is a tag visual-studio-2012, I assume you are running Windows. There is a great opensource program called WinCompose, which allows to use easy-to-remember and intuitive shortcuts for a huge amount of Unicode symbols, including numerical super- and subscripts. Every shortcut is invoked via a Meta key (e.g. Right Alt), for example:
Meta + ^ + 1 gives ¹;
Meta + _ + 9 gives ₉.
WinCompose also supports search, can be run in background, and eliminates tedious procedure of calling Character Map with subsequent copy-pasting or remembering the Unicode charsets (but the latter are also listed):
P. S. I'm not affiliated with this software by any means. Just a happy user.
One more way for WPF users,
<TextBlock >
<Run>x</Run>
<Run FontSize="8" BaselineAlignment="TextTop" >2</Run>
</TextBlock>
Change BaselineAlignment to TextBottom if you want to use as subscript.
In VsCode download the extension "Fast Unicode Math Characters".
The hotkeys for ₂ is \_2.
The hotkeys for ² is \^2.
Looks like there are some simple tags that you can use to make any text superscript/subscript. The superscript tag is <sup> and the subscript tag is <sub>.
https://www.w3schools.com/tags/tag_sup.asp
use (Ctrl + Shift + P) command to apply superscript and subscript in Visual Studio.
This is how usually I tend to do it on Mac.
In the VS code, hit (Control + Command + Space) to bring up the Character selector and search for 'superscript' in the search box.
Click on required superscript and add it. And here is the result. Screenshot are from the VS code only.
This approach should work across most of the apps in the Mac. Tested in MacOS 12.5. (Monterey)
There are several solutions. Personally, I simply formaat the label text in Word, use a screen capture and save it as an image that I use with a label.

Resources