• You are not logged in.
  • Index
  • General
  • My current programming symbols layout

My current programming symbols layout

  • Started by jaroslaw
  • 26 Replies:
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

I am working on my symbol keyboard for programming.

Here is what I have now:

https://imgur.com/vhCrA06

Some explanation:
- using right alt makes it difficult to use the right side
- I added "=>" for easier typing lambdas
- for symbols not in the layout, I just use standard layout

I have some problems with left bottom and right side.
I am using mac and adding layers seem troublesome.

Any suggestions? I am planning to add arrows and home/end etc under another layer (sth like dreymar extend layer).

I know this is old topic but it would be nice to start the conversation again :) since it seems there is no standard (except extend layer)

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

I don't see how that can be so useful, myself. If anything, I'd personally prefer using middle and ring fingers for opening and closing anything, instead of two pairs of fingers which feels confusing. That's how I do it in my Colemak[eD] mappings.

With Extend you can add bigger chunks of boilerplate, like a set of tags and then move the cursor in between them. But you don't have that on a Mac, unfortunately.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

I have gone through a similar process as you, and went through many variations, before eventually settling on my current symbols layer.

I started with the brackets in pairs like yours, then went through a phase where they were symmetrically on opposite sides (i.e. left bracket on T, right bracket on N). Finally I settled on my current arrangement with pairs on brackets on the same finger. This might at first seem like a error, bigram-wise, but in practise, editors used in programming usually fill in the corresponding closing bracket for you, making the opening bracket more common. Typing pairs of brackets together is generally uncommon, and I find keeping matching brackets on the same finger is more memorable. This also leaves the right-hand side free for a numeric keypad on the same layer.

altgr_programmer_angle.png

Obviously I also have an Extend layer too, which is mapped on LeftAlt.

Last edited by stevep99 (05-Apr-2019 13:38:43)

Using Colemak-DH with Seniply.

Offline
  • 1
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

Actually, I set up opening brackets on the home row before but was closing brackets more than I thought. Especially I have a lot of "()" in my code for argument-less functions so its useful.

I was also thinking about moving my altgr to the right of the letters (have one spare key between last letter and enter).
Also I noticed "=>" is quite useful.

Offline
  • 0
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

qaOMW5R.png

So this is my new setup. When I want to use symbols I move my right hand one key to the right. This is better than right since i dont need to leave the home row
I also use right alt with "ijkl" arrows mod. Its better than normal arrows position but still not that comfortable.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

Extend arrows is a hundred times better imnsho.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 1
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

So I tested few things and my layout looks like this now.

default:
mHMI3P9.png

The key on the right is dead key. When I want to use other layers, I move my hand one key to the right and stay there ("symbol input mode"). This key activates "layer selection layer" which is a layer with bunch of dead keys giving access to different layers. LSL looks like this:

fUTgbcD.png

So each key is a way to access symbol or number layer. These are my current layers:

I7uK6J8.png
PxpvCxR.png

Accessing each layer need two presses of keys, but it is set up for different finger and hand alteration so it's quite fast and easy to access.

This layout gives me access to all symbols I need very close to the home row.

I also use custom extend layer on caps lock press.

I decided to put closing brackets on top because I decreased the use of them with the extend layer.

I am quite satisfied with this layout and will write more when I get used to it.

Last edited by jaroslaw (24-Apr-2019 05:14:18)
Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

It's an interesting idea, but I'm not sure how the dead keys are supposed to work. Looks like you have to press and release your layer selection key, then press and release you selected layer, then type the symbol key? Do you then automatically return to normal mode? I don't quite get how you would type a sequence of many symbols.

I think I still prefer the more conventional layer system i.e. Shift, AltGr, AltGr+Shift, Extend, Extend+Shift, Extend+AltGr, Extend+Shift+AltGr - which should provide for more than enough layers that anyone could reasonably need. The trick is to define the modifier keys to select such layers in convenient places.

Last edited by stevep99 (24-Apr-2019 14:39:19)

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

Yes, you need to type two keys to access symbol layer. After that you type symbol and automatically return to normal mode. Yes, it is not efficient for sequence of symbols, but:
- usually i just type 1-2 symbols
- switching layer is on home row so its easily accessible
- you could use altgr but its only one layer, and altgr key in not so easily accessible
- you can have a lot of easy accessible symbols

You could use it with usual modifiers, for macros etc

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

I guess it comes down to chording vs sequences, a bit like Emacs vs Vim. ;-)

Hitting the three keys in sequence instead of holding down AltGr(+Shift)+key is one more key press some of the time, but at the same time it's less cramped. Sean Wrona, world typing champion, says he uses CapsLock for Shift to avoid the chord because at high speed misfires can easily occur with chording! That's a concession to one more key press from a speed champion actually, which is an amazing piece of info. (I guess he should've used Sticky Shift instead? But maybe competitions don't allow special settings?)

Good thumb keys make chording better, and as SteveP points out chording is superior for long sequences. So chording definitely has its merits. But for single-shot stuff a "tap dance" like this can be at least as powerful, and allow for nearly infinite variations. And I realize there's a lot of power in single-shot layers. Currently I have two "chord-n-hold" Extend layers (nav/edit and NumPad) and two single-shot ones (coding snippets and powerstrings/kaomoji). The latter could more easily have been accessed through a "tap dance" sequence.

[Disclaimer: Some use the term "tap dance" to refer to the mashing of one key to access layers, which I think is a bad idea. It's much easier to press one key and then another and then a release, and that's as much of a "dance" so I'll call it that here.]

One hitch is that you need to be able to chain dead keys. Not all implementations support this. It's on my TODO list in EPKL but I doubt it'll happen next week.

I think it can work very well actually! But personally, I wouldn't accept losing neither the apostrophe nor any of the other normal keys to this "Mother of Dead Keys"! That's just me I guess. So... I'll have to think about how I'd do it. My first thought is that maybe ... maybe the Extend key could be a multifunction key with this dead key on tap – even with a timeout to it so if you don't hit another within a second it goes back to nothing?

In my Colemak[eD] layout I have 20 dead keys now! And I'd actually like a few more but there isn't much room left. These dead keys are all on AltGr+symbol keys so while they're fairly accessible they're not very much so. This dead key chaining concept opens up a world of interesting possibilities I must say. All the dead keys could be on letter keys so they'd be readily accessible once the MoDK was active. One would have to devise a good mnemonic system for them of course, but that should be feasible.

In EPKL, a dead key may release not just accented and special glyphs but anything really! So you could have a dead key layer for powerstrings and whatnot.

Wow, this is really interesting!

Last edited by DreymaR (26-Apr-2019 08:55:27)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

The main problem with chording comes about because the standard keyboard stupidly has the modifier keys in the corners, where they are uncomfortable and inefficient. In that respect I can see why there is case for dead keys - for certain specific purposes.

For example, I can see why you wouldn't have long sequences of some symbols - for example accented characters - and for these dead keys can make sense. But there are plenty of other symbols where you would want to type a sequence. Most notably, you have your numbers in a symbols layer. I'd say this number layer is basically useless if you have to type three keys to type each number. It's certainly not better than having a chorded symbols layer activated via a thumb key.

Last edited by stevep99 (26-Apr-2019 13:19:34)

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

Thanks for a long reply. Yes, altgr is superior for long sequences of symbols. But I really like the idea of sticky shift and dead keys. Yes, its more keys but feels better.
You could replace numbers layer for a set of dead keys and it would not require 3 presses but those keys are a little stretch.

Also sticky shift could be a nice addition (as a colemak mod) as we usually need only one letter to be uppercase (pascal case or just regural sentence).

Yes, the number layer is bad.

How about moving modifiers to more comfortable places? We already are using caps lock for extend or delete, why not use additional key to the right of "O" to get altgr or even ctrl.

I was also thinking about explicitly exiting symbol layer but im not sure about the implementation.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

This makes me realize that a sticky Shift is in fact just a dead key – usually with a timer on it! And indeed, there are layers that you want to stay in like navigation/editing and numbers – these are best served with proper Extend modifiers. And there are one-shot layers for releasing rarely used glyphs of which there are a multitude – these may be better served by dead keys and to accommodate the plethora of possibilities chained dead key sequences will be necessary.

Not sure how to make my idea of phonetics input work (there are a lot of IPA glyphs! – but once you type phonetic you'll need several in a row), it should be a middle ground. Having a modifier-activated layer populated with dead keys might work, especially if they could release each other without leaving the main "phonetics" layer! I'll have to ponder that, and implement it.

Not sure what you mean by "explicitly exiting symbol layer"?

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 23
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 482
DreymaR said:

Not sure how to make my idea of phonetics input work (there are a lot of IPA glyphs! – but once you type phonetic you'll need several in a row)

Keyboard layers and deadkeys don't scale well for large and diverse alphabets or character repertoires (IPA, Chinese, math symbols if you need more than a handful, ...).  Better options are compose sequences, an IME, or a higher level formatting language.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

Yes, well, you're right. But Compose as such is a somewhat Linux-bound thing given that I don't want to run extra software; a similar argument goes for IME which at heart are just special cases of Compose. Maybe Compose will find its way to EPKL in the future, but meanwhile I'm thinking about making do with what we have available in the nearest future. And that's layers and soon-to-be-chainable dead keys.

The difference between Compose and dead key chains is minor in some respects, apart from the concept that Compose sequences can start out with any glyph while DK chains need to start off with a Mother-of-DKs (MoDK) dead key. This, of course, makes Compose more powerful – but can also make it a bit annoying like any AutoCorrect scheme. Some Compose sequences do start out with an accent key since that's tidy; these particular sequences are like DKs. With IMEs and other Compose sequences the accent or whatever-it-is is added after the glyph to be modified; one example is the most common Vietnamese IMEs.

All this is interesting stuff. Good point, Ghen: We don't have just layers and DKs but also Compose. And there are crossovers between all of these.

Last edited by DreymaR (07-May-2019 14:11:59)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 23
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 482

Dead keys are perfect for what they were "invented" for: the extended Latin alphabet, since for the most part it's just a matrix of letter + diacritic combinations.

IPA or the extended Cyrillic alphabet for example are different beasts; there are many arbitrarily different extra letters (not a nice matrix), often similar/related (which makes it hard to create predicable and consistent deadkey combinations), and while you can of course create arbitrary deadkey combinations for anything you want, you will have to remember them.  Compose sequences OTOH can be made mnemonic and predictable, for example Compose+N+G for IPA /ŋ/, Compose+L+/ for Polish Ł, Compose-plus-minus for math symbol ±, etc...  I have a .XCompose file in my homedir (very portable) with loads of extra symbols that I occasionally need, but which would never fit on my keyboard.  Compose sequences scale quadratically and beyond, not just lineairly with number of layers and deadkeys. :-)

IME's are not just Compose sequences on steroids.  A very simple example is long press on many touch screen keyboards, eg. long press on A lets you select any A+accent combination, but also æ, without the need to remember anything but "looks like A" (speed will drop accordingly, of course).  Or they can be context aware, like advanced Chinese IME's (which I have no experience with).

Compose being Linux (or rather X11) specific, well... I just consider that a shortcoming of other platforms. ;-)

Offline
  • 0
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

I meant that when you press a dead key then you stay on that layer until you press "exit this layer" key.

Last edited by jaroslaw (08-May-2019 02:54:26)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

Ah. But then technically it's no longer a dead key but a layer lock key (and the exit key would be a layer release key). Dead keys may be considered layer latch keys (that is, the layer stays active until any key is pressed) which is related but not the same.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 23
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 482

Yes, that comparison makes sense.  Until you start combining dead keys, eg. for Vietnamese. :-)

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

No, it makes sense for chained dead keys as well. It's just that in this case there's a latch queue, which then makes it a bit more similar to Compose.

Incidentally, I've made a Vietnamese layout that doesn't use DK chaining, in cooperation with a native speaker. It's in EPKL. The AltGr and dead key functionality took him a little while to get used to as he had used the usual IMEs in which you add the accent after the letter, but he seemed satisfied.

Last edited by DreymaR (09-May-2019 08:30:23)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 23
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 482

I read your Vietnamese topic with interest.  Without knowing the language, I think you were right to treat the extra vowels as base letters and only the tone marks as diacritics with dead keys.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

That's how I understood my native partner icedryst. It's a pity the people who transcribed Vietnamese first weren't more forward-thinking (although how could they have been...?): Had they used special letters for the extra vowels instead of piling on accents, the whole thing would've been much easier typographically. As it is, those multi-accent letters can often be a bit ugly and unclear in type. It would've helped if for instance they had used existing ligatures/slashes/bars instead, for instance æøåʉů could've come in handy!  ( のvの)

Last edited by DreymaR (13-May-2019 09:51:44)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 23
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 482

Perhaps the tone marks were added later, when the accented extra vowels were already established?

The Cyrillic (Soviet era) codification of non-Slavic languages has the opposite issue though: they added a lot of extra base letters (often very similar to one another but not the same) instead of having uniformly used diacritics on existing letters.  Making it a mess to design a consistent keyboard layout that covers all Cyrillic (see Rulemak topic).

But we're getting off topic. :-)

Offline
  • 0
  • Reputation: 0
  • Registered: 22-Mar-2019
  • Posts: 20

It's been a while since I have posted here. I found a layout which is quite comfortable for me.

So the basic layout is colemak dh wide, with small change - "," is replaced with dead key leading to symbol layer and "." is replaced with dead key leading to uppercase letters layer. I also use extend layer.

b2tGxo8.jpg

Uppercase letter layer is similar to shift layer, and exits after typing one key. When writing a sentece or programming I usually type one uppercase letter and then string of lowercase letters so it is enough in most cases. Also it is easier on fingers that holding shift.

FStMc7T.jpg

My symbol layer is just normal symbol layer, but entered with dead key. I guess I could add access with alt as alternative when typing long symbol strings but it is enough for me. There is also one dead key which leads to second symbol layer.

l8L6h3q.jpg

The last layer is just second symbol layer. To access it you quickly press "symbol layer" dead key twice so it is quite easy to remember and navigate.

V8FNALa.jpg


So this layout minimize the need to hold shift or alt, but leaves an optional hold feature too in case you need it.

I really like the placement of most keys, but would probably move some symbol keys if was using different programming languages.

So what do you think?

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

Your 'one-shot uppercase layer' is in fact just a sticky Shift (minus the ability to hold it down as well) and for me there isn't a good enough reason to sacrifice the period for sticky shift just to avoid the little distance. I prefer just making the real Shift key(s) timed, whether by OS settings or EPKL.

I don't much like the idea of double tapping comma for closing parentheses. Maybe a roll would be better, like {comma,period} instead of {comma,comma}? But basically I prefer using both the home and upper rows instead of having an extra layer.

What I use now is EI = (), UY = [], N = () with the cursor moved between the parentheses and L = [/] likewise. O = Backspace both on Extend and the tap layer. Seems nice to me but I've only used it for a short while yet. I like the consistency of <>, the normal () and my Cmk[eD] (AltGr) ‹›/«» mappings all being on the right hand middle/ring fingers.

Inspired by you I just added !@#$% on QWFPB and *^=+& to ARSTG.

Last edited by DreymaR (12-Jun-2019 13:49:40)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Index
  • General
  • My current programming symbols layout