• You are not logged in.

DreymaR's Big Bag of Keyboard Tricks - PKL/Windows Edition!

  • Started by DreymaR
  • 155 Replies:
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

First off, there's a pound sign and a ¬ sign in my Colemak[eD] so you could just jump right in. I've grown tired of national antics that shuffle symbol keys around needlessly; for instance, the Nordic countries each have their own placements of symbols like § for absolutely no sane reason. The special slash used for pence isn't much in use anymore I think?

However, do feel free to change things as it's really simple to do in my opinion. In the layout.ini file you'll find all you need and it supports pasting in unicode. And feel free to ask if anything puzzles you. Anything in particular?

Last edited by DreymaR (14-Nov-2013 17:32:37)

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

Offline
  • 0
  • Reputation: 0
  • Registered: 02-Jan-2014
  • Posts: 11

Hi DreymaR.

first of all I have to say "thank you & mateFarkas" for your work. I (yet) use custom modified qwerty layout in xkb/windows to eliminate nonsense differences between national layout and US and to add navigation keys on alt-gr combinations. But I've never found a way of doing the latter in windows, and you did it and pushed whole thing a lot further.

I've read your two threads (most of it) and part of mate's thread, but have few questions.

* I've found few inconsistences --> image shows that some key should write a letter, but nothing happens or something else happens (for example moving mouse is elsewhere than on image). Is some images obsolete or is something wrong at my place?
* Shortcut for suspending (ctrl+shift+´) works, but the other ones (exit, change layout, mapped to ctrl+shift+1 .. 4) dont. Why's that?
* in your qwerty layout shift-end does select text, but in colemac don't. Why's that?
* what's the purpose of mapping ctrl, alt and other modifiers in extend layer?
* is there possibility (and also in linux xkb) to create macro's in extend layer or create another layer where macros will reside?
* in colemac layout.ini there are sections of [deadkey...]. I did not find where's deadcode defined & how this work. Let's talk about deadkey5. First line says 0 = 126, which could be deadcode definition since I'm not aware about char having numeric value of 0 and 126 relates tilde char. Am I right? But when I press tilde button, just "~ " is written and ~ does not act like deadkey. Why's that? Why's that space printed after tilde in "~ "? Is it somehow related to "systemsDeadkeys = `´¨^~" in pkl.ini? I do not understand it. Symbol ~ is specified here, but is does not act like deadkey; if I remove it (since tilde is not deadkey in my windows-native layout) the only thing that happen is that space after tilde is missing now. What's the story around deadkeys? PKL somehow swallows the one defined by windows-native layout and I cannot see the way they're put back.



If there is any more reading, even background one, documentation please send me links.
I know this is a lot of questions, I'll try to study some more by myself and finding answers, but answering them would help me a lot and probably others too.

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

Hi Alfonz!

• 'Colemak' is spelled with a 'k' at the end. Thank you. ;-)
• The images are obsolete with a vengeance. I never got around to figuring out the perl+something+browser thing to make new ones.
• Ctrl+Shift+1–4 work fine for me (1 shows the image, 2 changes layout etc). Maybe you have something else remapping these?
• You can change those hotkeys to something that works for you in the pkl.ini file.
• In my Colemak[eD] PKL layout, Shift+End does select text whether I use the physical Shift or S with Caps+Y for End.
• When using the physical End key with the Colemak[eD] you're right; it doesn't work. This is likely because I've made VirtualKey mappings for the physical End key so I can use it with Caps for keyboard mousing. I never use it as End anymore since I have the better Caps+Y for that. If you need it back, comment out the mapping of 'SC14f = END' in the layout.ini file and possibly in pkl.ini too.
• For macros, you'd have to either edit the PKL source code or run some other program. I'd prefer the latter.
• I'd like to have ligatures though (sequences of characters mapped to one key press) but they're only available for Extend I think.
• You have to add the OS dead keys of your keyboard to pkl.ini in the 'systemsDeadkeys = `´¨^~' line to avoid the space. Only those.
• Then, when you press the 'deadkey5' key for instance the layout.ini has a [deadkey5] section describing what happens next.
• If you press the deadkey5 key twice or with space, it should release the '0 =' symbol (in this case the ~ glyph); but that's a bit buggy...
• There's not much by way of background reading other than what I've linked to in my sig posts. Did you find the AHK forums post on PKL?

Last edited by DreymaR (03-Jan-2014 10:06:34)

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

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

Update: In case anyone didn't notice and needed to, I've added Ghen's Rulemak for Cyrillic script to my PKL files! Yay.

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

Offline
  • 0
  • Reputation: 0
  • Registered: 02-Jan-2014
  • Posts: 11

Hi DreymaR,

sorry for the late answer, I did not have a time to test it. I'll reply on few things:
- Colemak it is, sorry, I've overlooked it.
- about that deadkeys: SEE LAST EDIT!! I probably did not understand your answer. Using colemak-eD_ISO layout and pkl.ini containing "systemsDeadkeys = `´¨^~", when I press any physical key which relates to listed deadkey, then dead key is not dead, it's get printed instead. I would expect, that when I press any listed dead key, no output will be printed. Then when I press following key, these two symbols will be somehow combined if possible. And when I press dead key followed by space, then dead key followed by space is printed. But that's not happening. When I press dead key, this deadkey is immediately pressed followed by space. Example: I've got no opportunity to type let's say í using dead key ´ followed by i, because when I press ´ it will be printed immediately followed by a space which I haven't pressed. Where's error? In my thinking/expectations or somewhere in configuration?

EDIT: I do believe, that configuration that ´~ and others are dead keys is lost somewhere. Since when I remove them from systemDeadKeys the space suffix is lost when I type them, so systemDeadKeys controlls only that space should be added when I type ´ or ~ etc. Which is wrong anyway I think (in programming there's lot of places when I want to type them without that extra space). But the main problem is, that ´~ etc. isn't recognised as a deadkey.

DEAD KEYS WORK JUST FINE. I've created my own help image on paper, and there are for example two ~ symbols. One IS dead key, the second is not. This is where my confusement come from.

Last edited by alfonz19 (24-Jan-2014 16:44:15)
Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

You know Dreymar, I don't think I ever properly thanked you for this wonderful bit of work you did in pkl. The extended mappings are like being able to take a little slice of vi and use it EVERYWHERE! I had some misgivings about the key selection at first, but I gave those up long ago. This just makes editing (any keyboard work) so much easier. Shame this is such a small self contained community, as this kind of advancement in human interface design honestly deserves some sort of award.

PS. while I am here anyways, there is something that has been bugging me. Is there a qwerty wide, non-angled, non-iso hidden away in here?


EDIT: Note to self - The next time you download a fresh copy of this, please remember (this time) to change the pkl.ini file so that systemdeadkeys (lines 60-61) is set to auto, and layout (line 12) is set as below.
   layout = qwerty-eD_ISO:Qwerty[eD],colemak-eD_ISO:Colemak[eD]

Last edited by cevgar (25-Jan-2014 13:35:31)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

Thanks for the praise, Cevgar! You probably know I'm a sucker for praise and consequently would make your ANSI Wide(28) non-angled layout for you. Check the latest upload. ;) There are lines in the layout.ini to convert it to a Z-Angle layout should anyone want that.

In the pkl.ini you may cut and paste the Angle and Wide sections as necessary from the "repository" sections further down. I'd start with the Wide pkl.ini and replace the Angle section as that's simplest and most consistent.

I followed your advice regarding the systemdeadkeys setting. As for the layout= line, the ones included are a) the ones I use and b) only meant as examples. I don't agree that your suggestion is the most intuitive one: Rather, I like to start in Colemak[eD] (which is what the Colemak user would autorun PKL for) and have a VirtualKey QWERTY on backup so you can switch into that when someone without Colemak skills try to use your keyboard (and still have Extend mappings). More frequently I'll just disable PKL altogether at that point, granted. But the main point is that with this you can make anything you like yourself.

Last edited by DreymaR (25-Jan-2014 20:43:52)

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

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

Alfonz: Ah, that explains the confusion.

I've made it so dead keys won't be a pain in the arse of those who use these symbols for coding and suchlike. So the shifted and unshifted versions of a key never are dead keys (except some much-used accents in locale Cmk[eD] layouts!). Then, coders can get their ~,^,' symbols directly without any fuss. More lingually oriented typers can find the dead key consistently placed on the AltGr mappings of symbol keys, and special symbols on AltGr+Shift.

Didn't I explain that well enough in the topic post? Maybe I should make it clearer? I thought it was clear, at least.

Also, the "BoardFig" image shows dead keys with a glow and you can clearly see the two versions of these accent symbols:

Cmk-ISO-eD-AWide35_90d-FingerShui.png

Last edited by DreymaR (25-Jan-2014 20:52:47)

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

Thanks for the Wide ANSI! I can't actually use the Wide mods at home at the moment (I've rotated the keys for Plover (Plover Wiki), see  this post if you are curious about the keyboard), but PKL is made for travel use anyways. As for the other bit, I ... uh... didn't mean you should change the deadkey or layout settings for everyone. That was literally a note to myself, so when I download the file again in the future, and probably run across the same problems (such as mistaking vk_qwerty-No[rwegian]_ISO for vk_qwerty-No[t]_ISO, because I am apparently terrible at reading documentation), I'll hopefully look at the thread, read my own note and know how to fix the problem.

In defense of the qwerty start; qwerty is more practical for me (not necessarily for you or anyone else) on a "Hey you, check this out! This program/script is awesome!" angle. The extended caps layer already has a learning curve. I try not to complicate things for converts with having to deal with fiddling with the PKL program as well. If I need it just for me, I have the time to swap the layouts, or even edit the ini file.


Out of curiosity, does anyone know if the extended caps layer can be done through the registry? Or MSKLC? Or if something like this could be done through an Ergodox's firmware, or the Arduino Hardware Remapper?

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

I now realize that No[rwegian] is a confusing locale – when it's the only one provided! Sorry about that. As mentioned, I'd like to ideally make more locales but PKL doesn't have a modular structure like xkb does so you can't make the Wide mod separately from Extend or the layout choice and that messes things up. I kinda wish I had the source code for PKL v0_4 (I only have v0_3_85), but Farkas Máté seems incommunicado these days. :(

The Extend layer probably can't be done in registry, but it should be possible to do something with the .dll file; that's not doable in MSKLC directly but by editing the C code it generates and compiling manually I suppose one could do it. It'd take a skilled coder though!

As for the Arduino, yes that should be doable and with any luck we'll make it happen! I finally got an Arduino starter set for XMas so I've started learning how it works, but I'm not yet quite there. When the dust settles, there should be an Arduino map that lets you do all sort of stuff modularly – wide/angle, layout, extend (both the primary and a keypad++ layer!) etc.

Last edited by DreymaR (26-Jan-2014 09:32:12)

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

Actually, speaking of suggestions, I do have one, though I haven't found a way to do it in PKL myself:

A key that will insert a horizontal tab character. Since, you know, the tab key's primary function these days has almost nothing to do with tabs or tabstops. Unless you are in a text editing application.

How, Windows: You can bypass Tab key behavior by inserting the Tab character directly with Alt Codes. The Alt Code for Horizontal Tab is 0009. To use it, you press and hold Alt, then type 0009 on the Numberpad (though sometimes you can get away with 009, 09 or 9). If your keyboard does not have a numberpad, you can't use Alt codes, because Windows is stupid like that. (perhaps the numberbar keys on the non shifted layout could be swapped for numberpad keys, leaving symbols on shift?)

How, AHK: An inelegant ahk solution might look something like this:

[hotkey]::
    Send, {AltDown}{Numpad0}{Numpad0}{Numpad0}{Numpad9}{AltUp}

How, PKL: ...I have no idea. Well, no idea aside from maybe adding a line to run an external script. I can get it to spit out 0009, and I can get it to use Alt+key, but I can't seem to get it to hold down the Alt while hitting multiple keys.


If it were working. I'd suggest the Tab Character for something like Caps+Shift+Space. (Of course the next problem would be getting a universal implementation of Elastic Tabstops)

Last edited by cevgar (26-Jan-2014 19:15:24)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

Oh my. The Tab character has ASCII code 009 (ANSI code 0009), so this is what you'll do:
AHK: Send {ASC 0009}
PKL extend mapping: ASC 0009
PKL layout mapping: Not sure

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

Brilliant!! Just what I was looking for.

BTW, if you ever wondered why I didn't make a Wide Mod PKL setup when I first posted the idea... well, having seen my attempts at ahk code, now you know. ;)

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

;Wasn't really sure about the netiquette on this one. On one hand, I was the last poster, and double posting makes me feel dirty. On the other hand, it was several days ago, and I am bringing new content to the table (kinda), which might be of interest to those that already read the last post on the thread, which just so happens to be mine. Decisions, decisions... Hell with it! *POST*


Edit: To clear things up before someone gets the wrong idea (because misunderstanding is what humans do best!), I am not suggesting/recommending/demanding that either of these changes I've listed below be applied to the bundled layouts by default. Just saying that these tweaks are working out pretty nice for me, and in case readers are interested, giving a basic outline on how I did them. ...and some light ranting for my own writing amusement.


Post Start
FYI: Turns out ={key} will allow things like Enter/Tab/Space in PKL layout.ini files. So, the horizontal tab character would be ={ASC 0009}. Found it on the first SC039 = SPACE line in the (eD) layouts.

Used this to set Shift+Space into Enter (after disabling the second SC039 entry), to simplify QuoteEnter combos.

;[rant]
;... and EnterQuote.

;...

;Actually QuoteEnter and EnterQuote tend to run together quite often, making it something more like QuoteEnterQuote. Or, if you have the good sense to write in a plain text editor, it will probably be QuoteEnterEnterQuote! Seriously, when was the last time you saw such poorly behaved punction?! Eh, was that a double, SIMULTANEOUS, consecutive finger use I just saw? And what if this was dialog?

;...

;Yeah; you guessed it. If you follow the books, the line up looks like this: LShift-Question mark. RShift-Exclaimation point. LShift-Quote. ENTER. Don't even get me started on smart quotes, ¿, ¡, « », etc. Despite their admitted advantages for both sytax and, when not strictly required, providing options for stylistic and expressive flexibility; there is little they can do that can't be done with creative use of more reasonable, and readily accessable, punctuation.

;Hmpf!

;... ...

;*cough*
;[/rant]

Yeah, so ANYWAYS: I also edited the layout to replace number row numbers with their number pad equivalents. Did this for easier access to various keyboard fuctions that require number pad, like Alt codes (because I TOTALLY didn't just go on a quarter page long rant about the evils of shift layers and alternative punctuation).

This should be especially useful on compact desktop keyboards that, for some unfathomable reason, often lack the embedded numberpad feature. The switched keys are not effected by Numlock state, and the change does not (seem to) interfere with normal usage or the shifted layers.  I did not swap symbols (+-/*) with their numberpad counterparts, as numberpad keys represent functions, not glyphs and do not work in text areas.



Sample Edits of {keyboard}(eD)\layout.ini:
(Yes, I know the columns don't line up. Increase tabstop size in your editor and it will fix itself.)

Space+Shift=Enter

;scan = VK    CapStat    0Norm    1Sh    2Ctrl    6AGr    7AGrSh    Caps    CapsSh

SC039 = SPACE    0    ={space}    ={enter}    --    ={space}         ; QWERTY Space

NumberPadBar: NonWide Layouts

;scan = VK    CapStat    0Norm    1Sh    2Ctrl    6AGr    7AGrSh    Caps    CapsSh

SC002 = 1    0    ={Numpad1}    !    --    dk15    ¡    ; QWERTY 1! - dk_dotbelow
SC003 = 2    0    ={Numpad2}    @    --    dk12    ²    ; QWERTY 2@ - TODO: dk_hook
SC004 = 3    0    ={Numpad3}    #    --    dk12    ³    ; QWERTY 3# - TODO: dk_horn
SC005 = 4    0    ={Numpad4}    $    --    dk17    £    ; QWERTY 4$ - dk_currency
SC006 = 5    0    ={Numpad5}    %    --    €    ‰    ; QWERTY 5% - TODO: dk_math

SC007 = 6    0    ={Numpad6}    ^    --    dk6    ∂    ; QWERTY 6^ - dk_cirkumflex
SC008 = 7    0    ={Numpad7}    &    --    dk7    ¬    ; QWERTY 7& - dk_caron
SC009 = 8    0    ={Numpad8}    *    --    dk8    ∞    ; QWERTY 8*- dk_ogonek
SC00a = 9    0    ={Numpad9}    (    --    dk9    ·    ; QWERTY 9( - dk_breve
SC00b = 0    0    ={Numpad0}    )    --    dk10    °    ; QWERTY 0) - dk_ringabove

And yes, while immature, I did think that sytax highlighting the comments in this post was amusing. (Though I don't know why it forced me to tag each paragraph separately)


EDIT: PS. The extended layer could technically include mouse functions (like horizontal/vertical movement, wheel and button clicks) too, right? While I can't see much point in it, as this... erm, mod[/?] is pretty much all about rodent desertion (or at least reduction), what could be gained? What do we feel would be the most efficient use of a second mouse layer, with the given keyboard functions?

... the only thing that comes to my mind is scrolling, really. Switch WheelUp/WheelDown to PageUp/PageDown, WheelLeft/WheelRight to Home and End, and maybe MouseMove to 1:1 scrolling or wheelclicks? Ctrl-click would be pretty pointless as holding down the Caps already involves the second hand, as would Shift-click.

On the other hand, making a mouse button into an extended layer control to, for instance, mirror swap the keyboard a la HalfQwerty... now that could be kinda cool.

Last edited by cevgar (31-Jan-2014 06:55:45)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

Uhhh, you're mad. :D

Good call on generic {key} entries in layout.ini files. I had forgotten that (although I seem to have used it at some point).

The Extend layer I have includes mouse functions (GD/<> moves, BKM presses). Right?

I did include a MirrorExtend file (in the 'other' folder for PKL), but as PKL can only handle one Extend layer I'm not using it.

Last edited by DreymaR (31-Jan-2014 21:46:26)

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

About the Extended Layer: Yes, the Extended Layer you included extends the keyboard to include mouse functions. Or 'Extend key+ keyboard key = mouse action'. What I meant was adding support for 'Extend key + mouse action = ???'. Since we have this extended layer anyways, why not fill it up all the way? The problem is, I can't come up with anything particularly worthwhile for the mouse layer to do (except for maybe provide more navigation options, which I stated in my last post). I mean, just about everything I need is already on the keyboard, and within pretty easy reach of the home position...

Last edited by cevgar (31-Jan-2014 23:50:44)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

Mad, but brilliant. That's cevgar all right.

I don't think you could map mouse *movement* that way, but we might look into the mouse buttons – effectively doubling the number of buttons available. Interesting thought.

The question is: What key events do you miss when mousing? Back/Forward and Cut/Copy/Paste do spring to mind, reducing the need for repositioning of pointer and/or hands. Triple-clicking can be annoying so one might map Caps+Bt1 to that (which would also allow you to "rapid-fire cheat" in some browser games, hehe). Ctrl+Tab and Ctrl+Shift+Tab might actually be very handy, for switching tabs in browsers and elsewhere (although some use Ctrl+PgUp/Dn instead). Same with Alt+Tab.

I believe the MouseWheel functions are actually button presses of sorts as well. So with Extend you could wheel scroll horizontally (not always supported, but neat when it is). In X.Org the standard Y axis wheel "buttons" are numbered 4 and 5, and the X axis ones 6/7. Another fun thought is VolumeUp/Dn; maybe WheelClick should mute/unmute sound then. The main buttons could even be song back/forward!?

I've had mice with extra buttons that were used for BrowserBack and BrowserForward. I liked that, although I've grown very accustomed to Caps+F/P for it now. Might be redundant to map Caps+MBt presses to back/forward since that works so well with the left hand. I've also seen Cut/Copy/Paste mapped to mouse buttons. Even if the ZXCV Extend mappings cover those functions they're still a bit awkward to press, and when mousing the focus is on the mouse.

In *nix there's this handy tradition of middle-clicking to paste selected text. We could probably make that work by making Caps+MBt3 produce a Copy,MBt1,Paste chain of key events? That'd be quite awesome I feel. (Not sure how to do that in XKB actually, but in PKL it should be feasible.) Since you'd have to hold down Caps and middle-click to make it happen, there's not any big chance that you'd trigger it by accident. (I'm wary of using Cut instead of Copy for any such mappings though!)

Mapping a mouse click to a new Extend-type modifier isn't supported by PKL today because of the single-Extend-layer limitation. But it's a cool idea. Given a long mouse cord or a USB extender cable you might even use a mouse as a new kind of elegant ghetto foot switch? A mouse button might be easier to use with your foot than the keyboard buttons are. The catch to that is that you'd have to disable the mouse movement for that mouse (I guess?); a piece of black tape over the laser aperture should do the trick. Also, the computer can't see one USB (HID) mouse from another so you'd shanghai the whole mouse button functionality that way – maybe too high a price after all.

[Edit:] This really got me thinking. What if we could manage to use the shift states together with Caps+MBts? That'd give us a plethora of mappings! Example:
Caps+LBt: Alt+Tab; w/ Shift (or S) Alt+Shift+Tab (switch programs); w/ Ctrl ???; w/ Shift+Ctrl ???; w/ AltGr(LCtrl+RAlt) hotstring???; w/ Shift+AltGr hotstring???
Caps+RBt: Ctrl+Tab; ––"–– Ctrl+Shift+Tab (switch tabs); w/ Ctrl Mute; ???
Caps+MBt: PasteSelected (or clipboard if no selection – that should work?); w/ Shift Copy; w/ Ctrl Paste; w/ Ctrl+Shift Cut; ???
Caps+Wheel: ScrollX; w/ Shift Vol+/-; ???

Just throwing out ideas; the potential really is quite huge if we can do this.

[Edit2:] According to the AHK docs, this is the list of buttons we may remap by their AHK names:

Mouse (mouse hotkeys require Windows NT/2000/XP or later)
LButton - the left mouse button 
RButton - the right mouse button
MButton - the middle or wheel mouse button

WheelDown - this is equivalent to rotating the mouse wheel down (toward you)
WheelUp - the opposite of the above
WheelLeft and WheelRight [v1.0.48+] - these two require a mouse with left/right scrolling capability, but they have no effect on operating systems older than Windows Vista.
(See mouse wheel hotkeys to detect how far the wheel has been turned.)

Supported only in Windows 2000/XP or later:
XButton1 - a button that appears only on certain mice 
XButton2 - a button that appears only on certain mice
Last edited by DreymaR (03-Feb-2014 23:08:12)

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

Interesting, isn't it? As I said before, the problem I'm having with it is that the extend key still requires keyboard use, so for instance: Caps+LMB=CtrlClick isn't saving much work over Ctrl+LMB=CtrlClick.

...wait. Wait a minute, hold on. Why not remap something like mouse button 4 to be a duplicate Capslock key? Wouldn't that allow accessing the extended layer without the keyboard? Sure it means one less mouse button, breaking the keyboard requirement for the extra layer is worth it, and you still get duplicates for all other mouse actions (Buttons left, right, middle and 5, if you have it; and wheel up, down, left, right). Plus, if I am mousing anyways, MB4+Z/X/C/V is certainly easier than Ctrl/Caps+Z/X/C/V.


As for mapping, as long as there is a extend button on the mouse: I'd probably put modifiers like Ctrl, Alt and Shift on the buttons, and other keys that are often used with these, like Tab, PgUp/PgDown and LClick on the wheel. If there is a combination possible which is not already being used by a program or the OS, I'd recommend adding a function to in in the layout (EG, your shift-states idea). Example, not too many programs use Alt+L.Click, Alt+Wheel, Ctrl+Alt+Wheel, etc.

Basic Example:
LMB=Shift
RMB=Ctrl
MMB=L.Click
MB4=Exend
MB5=Alt
WheelUp=Shift+Tab
WheelDown=Tab
WheelLeft=WheelUp
WheelRight=WheelDown

This is a very preliminary layout that gives access to switch cell, switch tab, switch program, zoom(ctrl-wheel), shift click, ctrl click... etc. Plus a couple of generally unused combinations. And then there is always the context menu as well. Though, since Shift is already present, maybe WheelUp should be set to Enter...


Of course, for me this would mean remapping my mice to actually HAVE a button 4 instead of a duplicate MMB. A necessity on both the Logitech T570 and the Marble Mouse, I assure you. (I love middle mouse button handling in browsers, with 'autoscroll' on page and 'open in new tab' on a link. Haven't figured out why it can't ALSO be used as paste in text fields, but whatever. Having it function ONLY as paste as I have seen in some linux distros seems like such a waste.)

Last edited by cevgar (02-Feb-2014 01:33:28)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

In this terminology (taken from XKB), buttons 4/5 and 6/7 are actually the Wheel Scroll Y and X axes which are handled as button presses! So yes, you could assign Enter to one of them ... but I feel that it might be a bit unintuitive? I think that for consistency wheel should primarily be kept to flipping between things – PgUp/Dn for instance.

I disagree with having an Extend button and modifiers on the mouse. What would you be using the left hand for (and you porn browsers out there need not answer that...!)? So the question is one of ergonomic benefits while using one hand on the mouse and one on the keyboard. Indeed, one-handed typing (mirrored?) combined with Extended mousing is a possibility – but I fear it'd be too tiresome and not efficient enough after all, like riding two horses. Anyone's free to try it out and tell me I'm wrong of course.

But back to ergonomy: Button chords on the mouse sounds like a bad thing to me, since the mouse hand gets enough flak as it is. The other bad thing when mousing is contorting that poor left hand to do stuff like Ctrl+Z, Ctrl+Tab, Ctrl+Q while mousing, and that's where a better way to reach such functionality that's useful while mousing could come in!

I realize from this that it's very much about the Ctrl button. The Extend chord Caps+T feels quite relaxed to me as a long-time user of it – but it can't be used for Ctrl+W for instance since the W key isn't accessible on the Extend layer. Also, hitting Tab with it is possible but far from nice. Maybe it's as simple as adding a Tab button on a Caps+MBt? Then Caps+A+MBt# flips between programs, Caps+A+S+MBt# reverses etc. The left hand, only making these Extend+mods chords, stays quite rested and free of twists but still active.

On the other hand, mapping a Caps+letter+MBt combo to Ctrl+Q or Ctrl+W is bound to create annoyance as windows are closed inadvertently. Better keep those hard to make.

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

To each their own. I like the concept of mouse only control, as I regularly use chorded mouse gestures in my browser. If this is just a function of needing more buttons, there is still the numberpad. (I think. You haven't Extended the numberpad yet, have you?)

Just checked out MSKLC again. For those who don't know already, it does allow a separate layer for caps (SGCaps), which can have its own shifted layer. Awesome. Problem is MSKLC requires characters or UTF-16 codes, which excludes almost everything useful.

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

Yes, the dreaded SwissGermanCaps. Apparently, they're not much used. As you say, MSKLC lacks the power of PKL to map practically everything around as you see fit. I still toyed with the idea of making a MSKLC layout with an extra AltGr set as it were – until PKL came along and caught my interest.

It was supposed to support "ligatures", that is, hotstrings up to 4 characters long. I don't think it does though. That's something I'd like to see PKL do better too: I'd like to have such ligatures or even strings of any length as dead key releases.

Okay, so I tried button-mapping with PKL out. Doesn't work so far.

In the pkl.ini [extend] section:

LButton = }!{Tab

This did nothing, but then again I've noted that keys (like the function keys) need to be mapped in the layout for them to work with Extend.

In the layout.ini [layout] section:

LButton = LButton    VirtualKey

This didn't enable the LBt to be Extend mapped, but disabled it completely! The other VK remappings are by scancode and I know no scancode/virtualcode equivalent for the mouse buttons.

There is actually a separate mouse hook (PKL, of course uses a keyboard hook), but I'm not sure that matters here. You can affect mouse buttons with the keyboard hook as we just witnessed.

I should check around for some AHK examples that may shed light upon the situation, I guess. But we may have overstretched here and reached a place where only editing of PKL source code would help...

Last edited by DreymaR (05-Feb-2014 16:53:37)

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

Ran a couple quick tests on PKL. Results:

-Scancodes are not required, but the extended layer and the layout.ini must match. For instace, either use [SC039 =] or [Space =], but do not use one in the pkl.ini and the other in layout.ini.

-Mouse keys hook just fine, if using the longer [eD] layout.ini format. Granted I don't know why or how you got that section to work, but I've included a mostly working example below. The 2Ctrl line still needs to be filled in to be fully functional, but that is the way most of the other entries were filled in, so I just mimicked them. For what it is worth, I was testing with WheelDown = Space and WheelUp = Backspace. (Example Shift+Space=Enter. And by the way, what is CapStat, and why do different keys have different defaults?)

;scan = VK               CapStat    0Norm           1Sh             2Ctrl    6AGr             7AGrSh    Caps    CapsSh
WheelDown = WheelDown    0          ={WheelDown}    ={WheelDown}    --       ={WheelDown}     ;Qwerty WheelDown
WheelUp = WheelUp        0          ={WheelUp}      ={WheelUp}      --       ={WheelUp}       ;Qwerty WheelUp
SPACE = SPACE            0          ={space}        ={enter}        --       ={space}         ;QWERTY Space

Unfortunately, it interferes with a modified version of the Accelerated Scrolling script I am running. Think mouse acceleration, but for the scroll wheel. Unless PKL can duplicate that functionality, I'm going to be disabling WheelUp/WheelDown lines from future versions of DBBoKT.


Next up: Mouse Movement! I'll get around to checking that later this week... sometime... maybe.


Whoops! I nearly forgot to mention, but unless I'm misunderstanding something, PKL does strings just fine. When I was making attempts to hook up the numberpad on the numberbar, I found that something like the below code will send the string 'numpad1' instead of '1'

;scan = VK    CapStat    0Norm       1Sh   2Ctrl    6AGr    7AGrSh    Caps    CapsSh
SC002 = 1     0          numpad1     !     --       dk15    ¡         ; QWERTY 1! - dk_dotbelow

EDIT: Oh, those BASTARDS! ...*sigh* forum automatically converts code tabs to spaces, so I've gone back and space aligned the columns in the code examples. If you want to use it, convert column separation back to single tab space.

EDIT: Also, MSKLC does support up to 4 code points on a single keystroke. I don't think that it counts as a ligature though, as the characters remain separate. You could, of course, use ligature code points to extend this limit... but why? The longer the string, the less frequently it can be used.

Last edited by cevgar (06-Feb-2014 17:13:41)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

That looks nice! I'll try it out.

Yes, PKL sends strings just fine (to get NumPad1, you'd need to use ={Numpad1}  [edited - I forgot the '=' ]). But not as dead key releases, which I needed. It'd be powerful.

The '2Ctrl' field is an inheritance from MSKLC, used to map Ctrl+keys which normally shouldn't be done as these are used for hotkeys. Ctrl+[ = Esc is an exception.

The CapStat field likewise. It denotes whether shifted keys and shifted AltGr keys are capitalized versions or not. If the shifted key is a capital version, add 1; if a shifted AltGr key is a capital version, add 4. So the D key where I have 'd D ð Ð' would have a CapStat value of 5. Not sure if it's important (probably not).

You can accelerate by adding a number after the key, e.g., {WheelUp 3}. Of course, it'll only be a multiplier and not true acceleration.

Last edited by DreymaR (07-Feb-2014 14:06:54)

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

Offline
  • 0
  • Reputation: 4
  • Registered: 04-Feb-2010
  • Posts: 149

Thanks for the clarification. Clarifications? And yes, I already got that numberpad thing cleared up. (You'd actually need ={numpad1}. Without the = it sends it as a string)

The deadkey restriction seems strange, but I'm not sure how the deadkeys even work in PKL. What do the numbers stand for? Can they be replaced with characters?


Not sure about that 2Ctrl field. When I leave the WheelUp/WheelDown 2Ctrl field blank(--) as I did in the example, Ctrl+MouseWheel combinations (like browser zoom) did not work. The keyboard on the other hand, starts having problems if that field is not blank. Confusing.

Last edited by cevgar (07-Feb-2014 13:59:14)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364

One thing: Send {Blind}{Key} may be good for mapping shift states as it preserves the modifier state. In Extend mappings, that's 'Blind}{Key' instead of just 'key' (not sure if you've guessed it but Extend mode adds a Send {} around your mapping so to cancel those braces I use a }{ pair - a trick I discovered a while back).

Last edited by DreymaR (07-Feb-2014 14:50:03)

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

Offline
  • 0