geekhack

geekhack Community => Keyboards => Topic started by: Witling on Sat, 31 March 2012, 09:19:17

Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Witling on Sat, 31 March 2012, 09:19:17
So there I am, typing happily along on my new ten keyless mechanical keyboard and I want to make a section mark in English §. Uh Oh! Stuck City as far as I can see. So I go to the source of copious knowledge. Are there solutions other than keeping a numeric keypad around?

Edited: Just to add a bit. I currently put those characters in using the Alt key and a numeric keypad. I want to use maybe 6 ASCII characters not found on a standard layout.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: megnin on Sat, 31 March 2012, 09:38:40
Even most separate numeric keypads, including the Filco, do not send numpad codes, but only the normal number codes, which do not work for Alt-code characters.

◄☺☻♥♦♣♠•♂♀► ██▒▒██

The best solution I've found is to use a Realforce™ TKL keyboard.  It's embedded number pad does send proper numpad® codes.  The NEO KB-87 also has an €mbedded number pad that sends proper numpad codes as does the Noppoo Choc Mini and the Happy Hacking Keyboard Lite 2.  The KBC Poker may also, but I don't have one yet to verify.
╔═══╗
═══
╚═══╝
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Witling on Sat, 31 March 2012, 09:45:54
An iPad seems like a bit of overkill when I can just plug in a keyboard with a number pad. I'm on my first mechanical keyboard. Itis a CoolerMaster and it doesn't appear to have an embedded number pad. At least they didn't put any marks on the keys and there's no function key to activate an embedded number pad. Cheap and worth it.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Daniel Beardsmore on Sat, 31 March 2012, 10:04:06
There are two kinds of character: those you know often enough to learn the code points, and those you don't. In the latter case, the number pad is useless as you can't enter the glyph without Character Map anyway.

For the former, just create an Autohotkey (http://www.autohotkey.com/) binding. Example Unicode Autohotkey_L script with bindings to open the script and to reload it after saving changes:

Code: [Select]
#NoTrayIcon
^!+Home::Reload
^!+End::ExitApp
+^!Insert::Run, "C:\Program Files\JujuSoft\JujuEdit\JujuEdit.exe" %A_ScriptFullPath%

+^!-::— ; shift+ctrl+alt+- = em dash
^!-::–  ;       ctrl+alt+- = en dash
+^!8::° ; shift+ctrl+alt+8 = degrees
^!8::•  ;       ctrl+alt+8 = bullet
^!l::…  ;       ctrl+alt+l = ellipsis

^!N::SendInput {U+2192}  ;       ctrl+alt+N = right arrow
^!M::SendInput {U+2212}  ;       ctrl+alt+M = minus
^+!M::SendInput {U+2122} ;       ctrl+shift+alt+M = trademark


Most characters, I get from the UK International Keyboard Layout (http://www.chiark.greenend.org.uk/~johns/kbukint.html), including dead keys, so in AHK I just add all the missing ones that I use.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: megnin on Sat, 31 March 2012, 10:06:10
A keyboard with an embedded numpad will have a numlock key.  On the Realforce it's in the place of the Scroll Lock and has an LED like the Caps Lock.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: sam113101 on Sat, 31 March 2012, 13:44:46
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
I'm using a tenkeyless leopold right now. Use a better layout.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Acolarh on Sat, 31 March 2012, 14:04:18
Quote from: sam113101;562679
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
I'm using a tenkeyless leopold right now. Use a better layout.

I agree. I can't remember when i last used Alt+numpad to type in unicode characters.
The US international (http://en.wikipedia.org/wiki/US-International#US-International) layout provides a whole bunch of special characters by using the right Alt key as an Alt Gr key.. For instance the § character can be made using Alt Gr + Shift + S.
Only problem with US international, is than on Windows there is no variant without dead keys (AFAIK).
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Daniel Beardsmore on Sat, 31 March 2012, 14:59:33
Quote from: sam113101;562679
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
I'm using a tenkeyless leopold right now. Use a better layout.

What do type on your keyboard to get a minus sign, “−”?

How about degrees, “°”, or typographer’s quotes?
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: bhtooefr on Sat, 31 March 2012, 20:57:16
Or consider switching to US International layout, at which point right Alt becomes a modifier that works on the main keyboard section.

However, IIRC there are some things that get annoying - IIRC vowels after colons being one example.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Acolarh on Sun, 01 April 2012, 03:16:07
Quote from: Daniel Beardsmore;562727
What do type on your keyboard to get a minus sign, “−”?

How about degrees, “°”, or typographer’s quotes?

Degrees °: Alt Gr + Shift + ;
Quotes “ ” : Alt Gr + Shift + [ and Alt Gr + Shift + ]
Minus sign: Well.. Not present.. Can't say I've ever needed it outside of LaTeX (or other applications where you don't have to input the actual unicode character in order to get what you want).

If I need some special character then it is very unlikely that I can remember the Unicode code point, so I'll have to look it up anyway.
 
On a side note GTK+ applications allow hexadecimal input of Unicode characters with Ctrl + Shift + U followed by a number of hexadecimal digits. (http://en.wikipedia.org/wiki/Unicode_input (http://en.wikipedia.org/wiki/Unicode_input))

☹⚓⚛⚠☭面☠☯☢
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Daniel Beardsmore on Sun, 01 April 2012, 07:52:42
I'm quite anal about “-” not being a real minus sign, so I use a real one everywhere I can. I mapped ° to ctrl-alt-shift-8 the same as a Mac, same for – and — (ctrl-alt-(shift-)-) as ctrl-alt-; (shift or not) is the UK Intl deadkey for ¨.

While Apple did a sterling job with their own system, they omitted key characters from extended ASCII such as × that consequently cannot be entered conveniently using opt (I think you get ÷ though). There are also characters like → that aren't in the 8-bit arrangement of Windows either; unfortunately I can't type that in any program that doesn't accept incoming Unicode characters, or where I'm using a font without it and the program doesn't do character set remapping. IE for example is really awful at this: you must state alternative fonts in the CSS such that every character you want is covered by one of the stated fonts.

No matter what layout I choose, there will be characters that cannot be typed. I've tried writing to John Sullivan, but he refuses to acknowledge mail, so it looks like the deficiencies of the UK International keyboard layout are forever (for example, no em and en dash), and if I didn't want the occasional dead key entry, I'd be tempted to ditch it and use entirely my own bindings.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Daniel Beardsmore on Sun, 01 April 2012, 08:16:50
Thanks.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: TacticalCoder on Sun, 01 April 2012, 13:41:24
Quote from: Witling;562479
I want to use maybe 6 ASCII characters not found on a standard layout.


The characters you're talking about are definitely not ASCII characters.   "paragraph sign" and "section sign" can be found in most 8-bit charsets (like ISO-8859-1), which defines 256 codepoints and of course in more complex standards (like Unicode) but they cannot be found in ASCII.

ASCII is a 7bit charset (typically encoded on 8bit whose highmost bit is always empty but that is another topic).  ASCII defines exactly 128 codepoints (some of which are special control characters).

Also, US-ASCII is definitely not ASCII (although this "name SNAFU" is a source of endless confusion).

Note that this is a common source of SNAFUs (and bugs) and, throughout my career, I have witnessed that, sadly, quite many programmers aren't even aware that ASCII defines 128 codepoints and not 256 (hence the many bugs and confusion related to this issue).

As a last note if I'm not mistaken all the printable ASCII characters (but not all the ASCII control characters) are available on any standard layout without needing to anything fancy.

Just pointing that out because we're on a somewhat nerdy forum ; )
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: megnin on Sun, 01 April 2012, 14:41:07
I think we *casual* programmers use the term "ASCII characters" generically to refer to anything we might or might want to type, print or generate with our keyboard, at least in my case.  And, to your point, perhaps that's part of the problem to which you refer.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: davkol on Mon, 02 April 2012, 14:15:05
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: sam113101 on Mon, 02 April 2012, 16:22:19
Quote from: Daniel Beardsmore;562727
What do type on your keyboard to get a minus sign, “−”?

How about degrees, “°”, or typographer’s quotes?

- – − ° “ ”
Still using a tenkeyless keyboard.

http://download.tuxfamily.org/dvorak/wiki/images/Carte-bepo-complete.png
It's a french dvorak layout.
Title: ASCII Characters in a Ten Keyless World ¶ §
Post by: Daniel Beardsmore on Mon, 02 April 2012, 17:15:24
I presume that minus must be alt-gr 8? Interesting selection – I presume it's intended for Belgians as well, given the Dutch IJ digraph on there (that leads down the Path of Pain – cf i/I vs i/İ and ı/I, ß/SS, “hyphen-minus” … Unicode is a crawling horror).

Not a lot of people give any consideration to undoing the damage to typography caused by the typewriter. The down side, though, is the issue that many desirable symbols require Unicode (minus being one of them). Windows hasn't shaken off ANSI yet, so having an actual keyboard layout where you can't type a lot of characters isn't a legitimate target for many layout developers, and even with Autohotkey it took some time before it was possible to generate Unicode characters via the Autohotkey_L fork. I have no idea what the situation is with other operating systems and frameworks.


The confusion over the meaning of ASCII is probably not helped by widespread use of "extended ASCII", which isn't ASCII, or standard, and isn't typically compatible with Latin-1 and therefore doesn't slot unharmed within UTF-8. What does upset me is that Britain was involved in the creation of ASCII and still no-one pushed for 8-bit from day 1 (cf C trigraphs), so it was unsuitable for mainland Europe from the get go. ASCII was never meant to be a standard – they plan for "national use" characters that would prevent international data interchange. :headdesk:

We've rushed into computing too fast, taking too many shortcuts and leaving a legacy of chaos in our wake. Nothing ever changes – look at the incompatible nightmare that is wireless.

Standardisation has always sucked.