Accessible hotkeys for superscript and subscript - web

I want to add a feature of making text super- or subscript to a WYSIWYG text editor in my web application and I need to set up hotkeys for it. Popular editors like Microsoft Word use Ctrl+Shift+= for superscript and Ctrl+= for subscript, but I can't use those since they trigger browser native zoom. Of course, I have separated buttons for super- and subscript and I will add hints to them, but I'd still like to make hotkeys as convenient as possible. Is there another common combination for these features?

Alternative Hotkeys
Ctrl + . for superscript and Ctrl + , for subscript are acceptable alternatives. (full stop / period and comma). They are the defaults set for Google Docs so familiarity will be reasonably high.
Accessibility Considerations
You cannot assume that any key is 'safe' as people may change their hotkeys to their preference.
For this reason you should always give people the option to change shortcut keys themselves in a settings menu (which should be easy to access).
You should also give people the option to toggle hotkeys on and off (yet again making the hotkey for that toggle customisable to their preference).
A lot of the time people come unstuck because they use a hotkey that overlaps with a screen reader hotkey and the hotkey doesn't work so make sure you consider the above before implementing hotkeys.
Also make it clear what hotkey is set for each item (to both sighted and screen reader users).

Related

Dyalog APL - Disabling APL symbol input

I recently obtained a personal licence for Dyalog APL and started using it (I'm switching over from APLX). I really like it, but whenever I'm not using the IDE, the APL symbol keybindings persist. For example, if I try to undo something in another application by hitting CTRL-Z, I'll instead get ⊂ and the undo will not go through. Similarly, attempting to use CTRL-S to save a document will result in me typing ⌈ instead of saving. The only way I've been able to resolve this is by restarting my computer.
How can I disable APL symbol input after the IDE is either not in focus or has been closed? If there's no way to do that, is it possible to map the symbol shortcut to ALT instead of CTRL? ALT is used far less often than CTRL for shortcuts, so I could live with that.
I'm using Windows 8.1 64 bit and the 64 bit version of Dyalog APL with a US keyboard.
If you want to use AltGr (right side Alt) to enter APL symbols while keeping a normal US layout or an almost normal UK layout, you can use my keyboard layout instead of the IDE. This avoids almost all clashes with other applications, so you can keep the keyboard active at all times and forget about mode switching.
Dyalog uses a standard Windows mechanism called "IME" (Input Method Editor) to enable input of APL-Characters. The advantage is that this enables you to use APL-Symbols anywhere - but obviously there is a 2nd side to that.
The "challenge" in your setup is only to change the IME back from APL to regular text-mode and this does not need a reboot. Pls check this article for more info on IME: https://www.google.de/amp/www.thewindowsclub.com/input-method-editors-windows/amp
(Sorry, I'm using W10, so I rather refer you to that article than giving wrong info... BTW, the advantage of W10 is that the IME will be default work in application-mode, so you can go to WinWord there and use default hotkeys w/o switching IME.)
Edit: For those using W10 (and probably W11) that article is out of date. The Languages settings are no longer in the Control Panel and are now in Settings. Go to Time and Language>Keyboard>"Input language hot keys" and change the Key sequence for "Between input languages". The "Switch Keyboard Layout" shortcut will be the one that toggles between keyboard layouts (I have Shift+LeftAlt toggling between Dyalog and US). You can also see which keyboard you are using on the taskbar by adjusting "Language bar options" on the same Settings page.

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.

Dvorak typers, how do you handle shortcuts like Ctrl-C?

Do you change the key binding in the OS to be, i.e., Ctrl-Q?
Do you manage to stretch your left hand to the C key?
Do you use right ctrl and press shortcuts with your right hand?
When I switched to Dvorak, I was using primarily Ctrl+Ins and Shift+Ins for copy/paste. Now I use Ctrl+C and Ctrl+V and other program-specific shortcuts, but I have just learned to use them in their "weird" locations.
A similar question was asked on SuperUser, with the following answers:
Use an AutoHotKey script to remap the keys. (Link)
Use Microsoft Keyboard Creator to remap them. (Link)
Install a third-party app that will remap them automatically. (Link, Link)
macs have it built in. there is a keyboard layout for dvorak with querty shortcuts. for windows, i use https://code.google.com/p/dvorak-qwerty/ it works well with ctrl and alt but dosen't work with the Win Key, which is not that bad.
The program AutoHotKey is what I use to map C,X, and V to their Querty origin.
I use none of the proposed solutions: instead, I modify CapsLock so that it becomes a dead-key that I use to program various actions. For example, when I press CapsLock and the key marked (in QWERTY)
S, this is mapped to Ctrl-X (and thus cut)
D, this is mapped to Ctrl-C (and thus copy)
F, this is mapped to Ctrl-V (and thus paste)
I, this is mapped to up-arrow
K, this is mapped to down-arrow
J, this is mapped to left-arrow
L, this is mapped to right-arrow
etc.
This is was dubbed 'Home Row computing' by Gustavo Duarte when he introduced this idea in https://manybutfinite.com/post/home-row-computing/ and then https://manybutfinite.com/post/home-row-computing-on-mac/
I'm pretty sure that this amounts for a large part of the speed I gained when typing, in addition to touch-typing.
On Linux, the solution that works great with some versions of Gnome on Wayland is this. It will set up all the rules on installation and will work transparently.
Previous answer:
Using Cinnamon, the following works when typing in some applications (i.e. vscode editor):
In keyboard settings, add QWERTY keyboard layout as the first in the list,
add Dvorak layout as the second
When typing text in an editor using the Dvorak layout, pressing Ctrl will still use the first (qwerty) layout.
This does not work in other applications, like Firefox browser, for example so can be pretty confusing.
Having a shortcut (i.e. Alt+Shift) for switching layouts assists in those cases.
While can be difficult at times, the advantage of this approach seems to be that it does not require additional software.
I've written Dvertkey, an AutoHotKey script, for this.
I've been a dvorak user for sixteen years, and for years I've used the various alternative keymaps mentioned in this thread, but all of them fall down when using a number of recent incarnations of Microsoft applications, such as the Office apps and SQL Server Management Studio. They seem to ignore Windows' own keymaps when using meta keys, rendering the hybrid layouts useless. AutoHotKey gets around this to ensure I get exactly what I want in any application.
I've been using Dvorak for so long now that I couldn't imagine remapping ctrl-c and other hotkeys to be in any other location than where they are supposed to be on the Dvorak keyboard. As for hotkeys, it's much easier and more natural to just use two hands to do the combinations. Use the left hand for ctrl and the other hand for the c-key. It would be too confusing to try and think ctrl-c and then press something else.
For the occasional windows game that requires WASD, I just switch the keyboard for the duration and if that means typing QWERTY sentences in chat then I just mentally switch and type a little bit slower.
Those characters are accessible with the right control key (a bit of a stretch for the x). If you are right handed, and have your right hand on the mouse, just move your left hand to the right control key and do the key combination

What keyboard shortcut can i use without conflicts with modern browsers?

I'm developping a web application and i intend to use mouse and some keyboard shortcuts, and if possible, use modal keys (Ctrl / Shift / Alt).
I've noticed a lot a conflicts with modern browsers/OS. Here are some examples you may know:
Ctrl+S
Ctrl+F
Shift+R : refreshes the page on firefox
Alt+left click : moves a window on linux
Ctrl+J : opens the download tab in chrome
I can't find what shortcuts (with modal keys) i can use safely in my application. Is there a list somewhere of a rule to follow?
You could have a look at this, which is a rather exhaustive list of used shortcuts.
However your question has already been asked here and here and it seems there is no such list.
Try this:
http://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
My suggestion would to throw something unique in the shortcut for example:
Say you needed to bookmark something quickly, chromes is ctrl+D, instead i would do ctrl+shift+m or ctrl+alt+m
Even still you might run into duplicate shortcuts, but going with something unique will give you the best results.
Hope this helps.

Shortcut with meta-shift key doesn't work in emacs

I can't use any shortcut that has meta-shift (alt and shift) in it because ubuntu will treat it as "change keyboard layout" shortcut (I map it to alt-shift since I use the same shortcut in windows) as soon as I press m-s. In windows change keyboard layout shortcut doesn't register until you release the key so any shortcut with m-s is usable in windows.
Is there any work-around without changing shortcut or meta key ? I kinda used to it.
Change the Ubuntu change-keyboard-layout shortcut, to something else.
Or use Esc as Meta
Nothing easy that I know of.
You can manually bind everything that's M-S-??? to C-M-S-??? in your .emacs or at least all of the ones that you use...
Or you can just change the short-cut... how often do you change the keyboard layout? (I use dvorak, and qwerty, but I've never needed a shortcut for it, I just use the button...)
I have tried different things, and in my opinion it is best to change the layout shortcut to something else. The power of emacs is all in its shortcuts that are available right there under your fingers. If you move the M key away and make it harder to reach, it will most surely have a negative impact on your editing speed.
Right now I'm trying to get used to switching layouts with the right Alt key. I almost never use it for anything, so missing it won't be a problem. And from my experience teaching yourself to switch layouts with another combination is a matter of several days.
P.S. Also it pays to use Caps-Lock as an additional Ctrl key, it helps tremendously!

Resources