• You are not logged in.

DreymaR's Big Bag Of Keyboard Tricks – USB2USB edition!

  • Started by DreymaR
  • 63 Replies:
  • Reputation: 2
  • Registered: 27-Sep-2017
  • Posts: 20

I've just taken a look and it seems too good to be true! hahahaah

I see that it can generate a AHK keyboard. What is that? Like PKL but made directly with AHK? If it's that and it works fine I'm amazed.

The TMK version how does it work? Does it use the "Alt + Num" trick and works only in Windows or what? Because I've seen some "UNIMAP" function and didn't understand much the code.

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

Aldo, would you care to explain how your KFLC program translates unicode input and ligatures to TMK code? Are you using a bunch of #define directives, macros, or what?

Also, how does that work with different system layouts, different OS etc?

Can KFLC translate everything in a PKL layout then? Like, huge dead key tables with chained dead keys and unicode output and whatnot? Seems almost impossible.

[Edit: Now I see that Eraicos has asked pretty much the same questions. Yeah, what he said then. ;-) ]

Last edited by DreymaR (15-Nov-2017 10:16:14)

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

Offline
  • 0
  • Reputation: 2
  • Registered: 27-Sep-2017
  • Posts: 20

I don't understand how your program does his thing.

For instance, in the example json of colemak only the "None" and "Shift" shiftlevels are defined but in the PKL colemak layout example there are defined more shift states and a lot of dead keys.

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45

The `lig` prefix creates a ligature, a string consisting of multiple characters. In the new version (v1.5.1) it is not necessary anymore to use this prefix for TMK, so you could ignore that.

And KLFC does not support Unicode characters for TMK, since they are indeed platform dependent. It assumes a US-QWERTY layout on the computer, without AltGr etc. It can just output ASCII, arrow keys etc.

Furthermore, KLFC can import huge dead key tables. Size doesn't matter for programs ;-). It won't support chained dead keys (in the PKL sense) for most other formats though, since it is not possible to express it nice. I may add it as a feature, since it sounds doable and I don't think that the dead key tables blow up that badly.

The colemak example does indeed only define the "None" and "Shift" shiftlevels. But the example is generated by executing

klfc colemak.json altgr_colemak.json extend.json -o output

So, it will also use the examples "altgr_colemak.json" (with all the dead keys) and "extend.json".

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

Offline
  • 0
  • Reputation: 2
  • Registered: 27-Sep-2017
  • Posts: 20

So, if for TMK it doesn't support ligatures, I can't do the "Normal" and "Shift" switch to have keys like "?/", or can I?

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

Dead key tables with nothing else than the US basic layout are pretty useless, as the main point of them is to provide alternative glyphs. However, I get that a translation program can't be expected to fix this!

However, it sounded like Hasu is about ready to implement a Unicode functionality into TMK. In the QMK world it seems they're tackling that and even making it support several OSs. Not sure how memory costly that'll be...?

Also, huge dead key tables is pretty much a memory issue right now, so I'm hoping the next-generation chips will be supported soon. Then we'll be looking at megabytes instead of kilobytes and all our worries will evaporate!

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

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45

TMK does support ligatures, but only ASCII ones. You can have keys like "?/" by creating a macro which, in the case of "/", clears the shift modifier, sends "/" and then restores the shift modifier.

Dead key tables for US-QWERTY are indeed pretty useless. I was talking about making such dead keys possible in XKB and keylayout. KLFC does not support dead keys nor Unicode for TMK. Methods to send Unicode are platform dependent and often don't work without configuration on the OS. I don't find them very satisfying.

Oh, and KLFC can indeed generate a AHK keyboard, which is like PKL but directly in AHK. It even has some extra features, like multiple extend layers and chained dead keys (like Compose).

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

Offline
  • 0
  • Reputation: 2
  • Registered: 27-Sep-2017
  • Posts: 20

Mmm... If I get it right, it could be possible to write, for instance, "á" with TMK and a keyboard layout that has the "´" deadkey.

If I want to write "á" when pressing "AltGr + a" I have to configure a macro that clears the AltGr modifier, sends "´", then "a" and restores the AltGr modifier, am I certain?

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45

Yep, that's right.

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

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

Eh, PKL has very chainable dead keys! Just so you don't say anything wrong.

Multi-Extend is nice though! I'm working on getting that into PKL_eD but it won't be next week.

Last edited by DreymaR (17-Nov-2017 09:37:27)

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

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45

What I mean by a chained dead key is a dead key which can output another dead key. Michael Kaplan also uses this term for such keys. The best example is the Compose key. (An input consisting of multiple characters can be viewed as such dead key.)

PKL handles dead keys smart. For example, 'slash'+⊆ triggers ⊈, with ⊆ generated by 'math'+<. This is something different, a dead key never outputs another dead key. Maybe we should call this something like nested dead keys to avoid confusion?

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

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

Hmmm. So chained dead keys are more generic in nature? Meaning that for each dead key you can specify a release that generates another dead key.

But "nestable" dead keys are also quite generic, meaning that if there are multiple ways of generating ⊂ then the slash dead key will produce ⊄ from all of them. But slash-math-< (⊈) may produce something different than math-slash-< which outputs ˝≮ in my current PKL file, since slash-< is ≮ and math produces ˝ by default; this may confuse the users! It's the same with the chained ones I guess.

Well well well, this is all very confusing isn't it. I rather like the PKL way, come to think of it. But I thought they were the same, heh.

*** 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
Newsflash: I've made some cool user functions!

Check out the FourLvlU and Extender functions in my main post in this topic, and in my code! I got the hang of it, eventually.
FourLvlU makes it possible to define Unicode input from the AltGr(+Shift) state(s) of a key. It's limited to a few keys but still cool.
    - So on my locked-down work computer I can now use the US standard layout (which has symbol keys where I'm used to them), but still type ÆæØøÅå.
Extender makes the Extend key more powerful: If I hold down RShift (configurable) and then press Extend (Caps) I now get the Extend2 layer. Neat!
    - I'd like to use the Alt keys for this, but they're tricky on Windows since an Alt KeyUp triggers the window menus regardless of the Alt mod state(?).
    - I've made four Extend layers possible but I've only seen the need for two so far. Let me know (in the Extend topic?) if you have any great ideas.
    - One idea for an Extend layer would be a hotstring layer! But that's too memory consuming for the current state of TMK devices. Next generation, please? ;-)

Last edited by DreymaR (16-Feb-2018 17:04:57)

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

Offline
  • 1
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,364
Jack Ma said:

Here is more information about the keyboard USB interface.

Ummm... I don't see any info there, just an order page? Sorry but I must ask: Are you a spambot?  (ʘ言ʘ╬)

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

Offline
  • 0