• You are not logged in.

    (Linux) Colemak Programmers Layout v3: Dual Function Modifier Keys

    • Started by Akiva
    • 10 Replies:
    • Reputation: 2
    • From: Leafland
    • Registered: 17-Sep-2013
    • Posts: 32

    vI will try to keep this brief, as I will be expanding, as this is currently in development.

    Version 1 Started about 2 Years Ago
    YsPz2yS.png
    Notes:
    - Supports APL (Which I incidentally never used). The one advantage of that, were that unique characters could be programmed in vim for unique functions.
    - Reverse Keypad on the left. Very hard to get used to.
    - Caps as Backspace, Shift Caps as Delete did not work.
    - Movement Keys inspired by Vim Layout. Very Successful.

    Version 2 Started About 4 Months Ago
    Y1q8DGi.png
    Notes:
    - Reversed () to )(, and placed }{ on the shift. Works much better.
    - Tried a left hand directional key strategy. WARS (WADS in QWERTY) is awful. So is FRST.
    - PSCT however is amazing. You will do All direction with your index and middle finger.
    - = kind of reminds me of an Enter type key, so it made sense to put it on the side.
    - Moving Left Shift and Right Shift up to the home row, are amazing innovations.
    - \ works well over the shift.
    - The Keypad on the right was much more intuitive, but not terribly comfortable, especially its lower row

    Version 3 (WIP) Starting Today
    0RqwhCX.png
    Notes:
    - Background Process (See Code Below) Allows me to do BackSpace on Caps, and Backwards-Highlight-Word on Shift+Caps. (And Vice Versa)
    - Mod-DH added
    - Mod for spreading keyboard added. Z and ? got wrapped as a result. Swapped hands.m
    - Directional Keys back on the Right hand, delegated to Level 5 to give compatibility to Google Spreadsheets (Which I use a lot). AltGr (Level 3) for whatever reason would delete cell contents.
    - Getting Backspace Functionality on my Caps, and placing "_" on <BKSP> Gave me enough free space to place the ":" on Level 1, as well as "&"
    - ' has been located to the mid, as it is not used very much, and is useful for both hands if typing characters into C.
    - Enter has been placed on the Right Shift, to test out the bigram of Period Return.
    - Moved Shift Top Row Keys onto Level 5 with the letters:
    -- @ = A [At]
    -- + = P [Plus]
    -- ` = G [Grave]
    -- ~ = T [Tilde]
    -- % = M [Modulus]
    -- ^ = C [Carat]
    -- # = H [Hash]
    -- $ = D [Dollar]
    -- ¦ = B [Broken Pipe]
    - Keypad has been shifted up


    We will see how it goes. In addition, the following code is handled quite well, with the exception of the difficulty in adding white space to Terminals. Otherwise it is fairly simple and clean that anyone should be able to read it.
    There is a tiny bug that I will fix later.

    The great thing about this is that it gives me the ability to add macros. I will be attempting later to do a Join Macro like that found in vim. Will try to keep the code here updated.

    (gpl v2) Author: Akiva Avraham, No warranty etc.

    #include <QCoreApplication>
    #include <QProcess>
    
    int main(int argc, char *argv[])
    {
    	QCoreApplication a(argc, argv);
    
    	/* Monitor Key Inputs */
    	QProcess xinput;
    	xinput.start("xinput test 11"); //fixme: Magic Number. xinput list to get device id (11)
    
    	/* Set Variables */
    	const QString backspace("xdotool key BackSpace");
    	const QString deleteKey("xdotool key Delete");
    	const QString backHighlight("xdotool key \"ctrl+shift+Left\"");
    	const QString forwardHighlight("xdotool key \"ctrl+shift+Right\"");
    	
    	bool capslock(false);
    	bool quoteKey(false);
    	bool clear(false);
    	bool combo(false);
    	
    	QString s;
    	
    	/* On Keystroke, perform action */
    	QObject::connect(&xinput, &QProcess::readyReadStandardOutput, [&](){
    		s = xinput.readAll();
    
    		/* Get Active Flags */
    		if (s.contains("key press   66")) { capslock = true; }
    		if (s.contains("key press   48")) { quoteKey = true; }
    		if (s.contains("key release 66")) { capslock = false; }
    		if (s.contains("key release 48")) { quoteKey = false; }
    
    		/* Logic:
    		 * We only want a keystroke to execute on a release.
    		 * Unless the release was done after a combo. */
    		       if (clear                                   ) { clear = false;
    		} else if (s.contains("key release 66") && quoteKey) { QProcess::execute(backHighlight); clear = true;
    		} else if (s.contains("key release 66") && !combo  ) { QProcess::execute(backspace);
    		} else if (s.contains("key press   66")            ) { combo = false;
    		} else if (s.contains("key release 48") && capslock) { QProcess::execute(forwardHighlight); clear = true;
    		} else if (s.contains("key release 48") && !combo  ) { QProcess::execute(deleteKey);
    		} else if (s.contains("key press   48")            ) { combo = false;
    		} else if (s.contains("key press ")                ) { combo = true;}
    	});
    
    	return a.exec();
    }

    TLDR:

    Holding Capslock will give you shift.
    Tapping Capslock will give you backspace.
    Holding SingleQuote (Right Shift), and tapping Capslock will give you a Backwards Word movement + Highlight, as inspired by one of Dreymars suggestions.  (Need to update due to mods)



    ------------
    After an hour of usage, I am already addicted to it.

    Question is now,

    Should I add functionality to my right control key, and how close to vim functionality can I get with xdotool?

    Feedback and ideas encouraged.

    Last edited by Akiva (05-Jul-2017 20:30:07)
    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,361

    So, yeah... that's obscure to me. No idea how to use it. A little more presentation, please? :-)

    Last edited by DreymaR (05-Jul-2017 09:22:57)

    *** 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

    Just wanted to flag up xcape in case you'd missed it, which seems similar.

    Using Colemak-DH with Seniply.

    Offline
    • 0
    • Reputation: 2
    • From: Leafland
    • Registered: 17-Sep-2013
    • Posts: 32

    Updated the OP.

    XCape... looks interesting. Ultimately I think the Qt code is cleaner and clearer to understand. Its nice when you dont have to use pure C.

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

    - Mod for spreading keyboard added. Z and ? got wrapped as a result.

    Unless you feel that apostrophe in the middle is comfy enough (I don't!) I suggest using what I call the Wide(Quote) mod, in which the apostrophe moves up to where you have the backslash (key SC01e, iirc).

    In the standard Wide(Qu) mod the brackets are together in the middle which is a bit elegant I think, but I suppose you'll want to keep them where you have them now. The main point is that the apostrophe is too common for the middle and I'm really used to hitting it with the pinky so it's annoying to relearn.

    No idea why you swapped hands for /? and Zz; any particular reason? In the Wide(Qu) mod the ? usually sits where you have the Z.

    Last edited by DreymaR (06-Jul-2017 14:33:00)

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

    Offline
    • 0
    • Reputation: 2
    • From: Leafland
    • Registered: 17-Sep-2013
    • Posts: 32
    DreymaR said:
    Akiva said:

    - Mod for spreading keyboard added. Z and ? got wrapped as a result.

    Unless you feel that apostrophe in the middle is comfy enough (I don't!) I suggest using what I call the Wide(Quote) mod, in which the apostrophe moves up to where you have the backslash (key SC01e, iirc).

    In the standard Wide(Qu) mod the brackets are together in the middle which is a bit elegant I think, but I suppose you'll want to keep them where you have them now. The main point is that the apostrophe is too common for the middle and I'm really used to hitting it with the pinky so it's annoying to relearn.

    No idea why you swapped hands for /? and Zz; any particular reason? In the Wide(Qu) mod the ? usually sits where you have the Z.

    No way! The apostrophe should be discouraged if anything. In programming, it is pretty rare given that characters are almost never used, and in english, they should be discouraged anyway given that contractions are considered poor english.


    z and ? were swapped due to the fact that a return carriage usually follows a question mark. Z is hardly important anyways these days.

    As you can see from prior versions, I have always had / on the seven. I love it there, important for commenting. // /* */

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

    I've never heard that contractions are considered poor form? I'm not going to start typing "I am" every time, even if some are of that opinion. :-)

    If you think so though, then that layout will make sense to you. However, in my programming the apostrophe is used quite a lot for literal quoting.

    Your commenting bigram is cute! I see it now.

    Stuff like that hand swap are the mark of solipsism. You're making a layout for you and you alone I guess. No idea why you're discussing it here then... nah, it's cool. Heh.

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

    Offline
    • 0
    • Reputation: 2
    • From: Leafland
    • Registered: 17-Sep-2013
    • Posts: 32

    I've never heard that contractions are considered poor form? I'm not going to start typing "I am" every time, even if some are of that opinion. :-)

    Could always throw it on the double quote.

    However, in my programming the apostrophe is used quite a lot for literal quoting.

    That is interesting. I actually got the suggestion to deprioritize the singlequote on stackoverflow who also stated that it is typically rarely used in programming.  It is interesting, kind of impressive actually that you have a use for it.

    Your commenting bigram is cute! I see it now.

    also there for html closing tags. One poor thing about it though is the loss of the ./ bigram.

    Stuff like that hand swap are the mark of solipsism. You're making a layout for you and you alone I guess. No idea why you're discussing it here then... nah, it's cool. Heh.

    I am thinking of swapping the colon and the question mark. I think the apl was solopistic for sure, lol. Otherwise, this is basically a c syntax layout as far as I am concerned.

    Offline
    • 0
    • Reputation: 0
    • Registered: 15-Oct-2017
    • Posts: 4

    I rarely use a double quote. I program in JavaScript as a day job. ' is used for string, " is valid though. ` is used for strings containing expansions. Also in all of my HTML, I use single quotes for all attribute values. Again, rarely use a double quote. As for contractions, it depends on your audience. In formal writings, they are discouraged. Everywhere else they are fine.

    You may be interested in a layout Jack Couch defined... Crackle. https://medium.com/@jack_21924/crackle- … dd04838231

    Last edited by jcowgar (15-Oct-2017 23:22:12)
    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,361

    In shell script, they're needed all the time (for variable expansion, wrapping literal single quotes, etc) so it depends on what you're doing of course.

    I think you'll have to be very formal to drop the contractions completely these days. I wouldn't write "would not" except to stress the "not", even in a scientific article. And I'd read "would not" as stressing the "not" which may not have been the writer's intention!

    It's fun to note that contractions was all the rage both in ancient and medieval times! When writing is hard and writing material costly, you'll resort to these tricks. Roman stone carvers used ligatures that we wouldn't dream of (not only the Æ and Œ of nearly-today but for instance ME, HE or NF stem sharing – even AM I think?), and the medieval practice of bunching letters on top of each other has led to accents like Ç (for CZ), Ñ (for Nn), French Ô (for Os; the graphic form of the caret is newer though), & (for et – "and") &c. &c. ;-)

    Last edited by DreymaR (16-Oct-2017 09:03:38)

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

    Offline
    • 0
    • Reputation: 21
    • Registered: 08-Oct-2017
    • Posts: 223
    DreymaR said:

    and the medieval practice of bunching letters on top of each other has led to accents like Ç (for CZ), Ñ (for Nn), French Ô )

    The german extra letters also come from the same in Sütterling an old handwriting that was very popular in germany the small e looked almost like " written a bit larger on the writing line and after a while the combinations ae, oe and ue became ä, ö, and ü. For ß though it came from another popular typeface called Fraktur, where sz was written together, which then became ß.

    I wonder how this happened with the scandinavian ø though, å I can kind of rationalize as an a that sounds more like an o, and it came from the old norse á when I'm not completely wrong, æ kind of makes sense, it followed a similar pattern to the german ä, but what the heck happened with ø, was it because so many of the other diacritics where already used, so they just made up something? :P

    Offline
    • 0