Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Portable Keyboard Layout


  • Please log in to reply
190 replies to this topic
danflory
  • Members
  • 5 posts
  • Last active: Oct 23 2010 11:39 AM
  • Joined: 02 Oct 2010
As I prepare this I have some question. These are just things I want to know they are not organized in any way.

1. How do I set up a hot key to select a specific layout? I know how to select from multiple layouts with the task bar menu, but haven't yet discovered how to code it.

2. How do I use the extend feature? It seems the only example layouts that use extend are prolemak_en and prolemak_hu, even though the extend* examples have virtualkey no example is given of usage. Even prolemak_en, that has an image doesn't seem to make use of the feature as far as I can tell.

3. Could we start using the sourceforge forum for discussion? This topic has over a hundred posts and is spread over several pages. It has been a real pain to search just this one topic among all of AutoHotkey.

4. What are your motives, and the motives of others you know of, for using PKL?... Multiple Language, Pain motivating keyboard change, Too many keyboard shortcuts .....

5. In your usage, especially when you first started, what were the questions that you wish were answered?

6. Is the source code for the coming version available for download? I didn't see it in the folder on SourceForge?

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
Hmmm...

1) I don't think you can? There's a hotkey (in pkl.ini you can set the ChangeLayoutHotkey) that switches between the layouts you've specified in the 'layout' string defined at the top of pkl.ini; that's what I use at least.

2) The example layouts are mostly virtualkey layouts I take it? This means that they don't really remap anything but merely let the PKL take a look at those keys defined as virtualkeys before passing them on to the input queue. What's important for the Extend feature is that there's a line in the layout definition under [global] that says for instance 'extend_key = CapsLock'. Then, I like to have the CapsLock key pretty empty in the layout itself so as not to cause confusion and potential hiccups (so I use 'CapsLock = OEM_CAPITAL 0 -- --' etc in the [layout] part). Now, the rest happens in the pkl. ini. The [extend] section there contains mappings you want to do whenever the Extend key is pressed and held down, like a new modifier key for moving keys around and more! For instance, I've posted my remappings earlier in this topic but here's a little excerpt to give you an idea:
; *** ESC/F1-F12
SC001 = CapsLock
SC03b = Media_Play_Pause
SC03c = Media_Prev
SC03d = Media_Next
SC03e = Media_Stop
SC03f = Volume_Mute
SC040 = Volume_Down 2
SC041 = Volume_Up 2
SC042 = Launch_Media
SC043 = Esc}{Browser_Home
SC044 = Launch_Mail
SC057 = Launch_App1
SC058 = Launch_App2

; *** Row 1 (numbers/symbols - left side)
SC029 = Del
SC002 = F1
SC003 = F2

[...]

3) Sure - if Farkas wants! He's preferred this one before but I see personally see your point.

4) My motives are: Portable remapping for Colemak (Wide mod); Extend mode.

5) How to use the Extend mode!

6) Up to Farkas, but if the version is _coming_ then it isn't _come_ yet! So I'd suppose that there's no point in asking before the version is up at least.
Better burden you cannot carry than man-wisdom much -- Hávamál

dano
  • Members
  • 4 posts
  • Last active: Oct 07 2010 02:13 PM
  • Joined: 04 Oct 2010
In DDvorak I think there is an error. When typing comma followed by another comma I received ", ," and when typing comma followed by space I recieved ", " : that is comma space space. Here are my changes to receive a single comma and a comma space for the preceeding uses:

[deadkey1],
0 = 44 ; ,
44 = , ; ,
32 = , ; space -> ,space

dano
  • Members
  • 4 posts
  • Last active: Oct 07 2010 02:13 PM
  • Joined: 04 Oct 2010
What is the magic to enable CapsLock to use the CapsLock column that is in the table? I need some key replacements that will use the sticky state of caps lock; but I can't get it to work.

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
I think you need to explain that a little more, dano - at least if I'm to understand it.

What table are you referring to? And what kind of enabling?

If you want to use the Caps state itself for remaps, you may be out of luck as I believe it's degenerate with the Shift state as far as the system input routines go. AutoHotkey can poll the Caps state but for that to work with PKL you'd have to compile your own PKL with additional coding; are you up to that?
Better burden you cannot carry than man-wisdom much -- Hávamál

dano
  • Members
  • 4 posts
  • Last active: Oct 07 2010 02:13 PM
  • Joined: 04 Oct 2010
I can recompile. I am looking for the correct place to insert my code for other things like hotstring abbreviation replacement, and attaching a keyboard mouse under the left hand :)

As For my previous question, The table I am referring to is the tab separated table in layout.ini.

On the headding line I see:
;scan = VK CapStat 0Norm 1Sh 2Ctrl 6AGr Caps CapsSh

I don't know how to get the Caps and CapsSh columns to be used. If someone knows the position in code that deals with the parsing of the layout I'm glad to read it and figure out.

Thanks for the help.

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
Not entirely sure, but I fear that may be a leftover from the layout file's origin as a MSKLC .klc file in which these states are specified? Or it could be I just never noticed where in the code that happens.

For keyboard mousing (which mostly sucks but can be useful at times) I myself use a part of the Extend plane to send stuff like:
SC022 = Click Rel 0,-17,0

If you aren't using the Extend mode for anything else, that's where I'd put my hotstring abbreviations as well but to each their own.
Better burden you cannot carry than man-wisdom much -- Hávamál

danflory
  • Members
  • 5 posts
  • Last active: Oct 23 2010 11:39 AM
  • Joined: 02 Oct 2010
O.K. I have read and understood the code. It is organized well enough.

To customize your layout edit the [layout] section of the layout.ini that, by default, is in PKL-root/layouts/layoutName/layout.ini.

Set the CapsState column to 8 on lines where you want to define a CapsLock and CapsLockSh. Other possible values for the CapsState are 0 that will block usage of columns past the first key definition, 1 to define only the shift state, 2 to define normal and Ctrl state, 6 to use AltGr, and the magic 8 to enable Caps and CapsSh columns. While the line in [global] "shiftstates = 0:1:2:6" is needed to enable AltGr and other modification states, state 8 and 9 are added in code so they should not be added manually.

The ini section has tab separated values and the first is the header that explains the purpose of that column. To see how the lay out works I needed to change my editor to show tabs and spaces and display tabs of 25 spaces. That way all of the columns lined up visually.

Here are three lines to give the idea. HotKey definitions use Auto Hot Key syntax, of course. To display properly I took out the tabs and lined up the columns using spaces, so these lines will not work by copy/paste!

;scan = VK   CapState  0Norm   1Sh     2Ctrl  6AGr  Caps        CapsSh
SC003 = x    8         *VERY   *GOOD   --     --    {=}Caps{!}  *{=}CapsSHift{!} ; QWERTY [email protected]
SC005 = 4    8         4       $       <      >     (           )                ; QWERTY 4$
SC004 = 3    8         *DO     *HOWDY  *==    /     \           *{home}{home}+{end}^c{end} ;

In the first line a missing * cause the output for CapsLock to display just as seen While the CapsSh will convert as expected. The last line shows my goal of using more complex actions on some keys. In my editor this copies the whole line and leaves the cursor at the end without any text selected; ready to press enter and paste, if that is the where I want to use the line. In testing the last line didn't work because I didn't have a trailing tab delimiter.

A form to modify this file would make it much more useful :)

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
So far, all we have is a way to parse .klc files from MSKLC (where you can't do this fancy stuff) via a Perl script Farkas made.

I've been working on a script to do more advanced parsing but no results thus far.
Better burden you cannot carry than man-wisdom much -- Hávamál

danflory
  • Members
  • 5 posts
  • Last active: Oct 23 2010 11:39 AM
  • Joined: 02 Oct 2010
What are you thinking it might look like. I was thinking of an a simple WinForm of some type that would replace MSKLC and allow entry of AHK valid strings.

Leftium
  • Members
  • 6 posts
  • Last active: Feb 13 2011 01:55 AM
  • Joined: 04 Jul 2010
PKL is very helpful for toggling the Colemak layout, but remapping the keyboard does not make sense when an IME is in non-roman mode (for example forming East Asian characters like Chinese, Japanese, or Korean; they assume the QWERTY layout so input with the Colemak layout is very strange: imagine trying to type ColeMak on a normal QWERTY layout).

I have modified PKL so it is more compatible with East Asian IME's:
[*:1yyczbe8]Automatic suspend/resume based on IME state.
[*:1yyczbe8]Remembers state of PKL before suspending due to IME
[*:1yyczbe8]PKL is always suspended whenever it doesn't make sense to use a non-QWERTY layout, but its suspend/resume state is restored whenever "English" is the desired input, again
[*:1yyczbe8]Changed the suspendHotkey to LSHIFT&RSHIFT (CJK IME's eat the RAlt key)I added a couple lines to PKL initialization and one of its hot keys. I also added a timer to monitor the IME state and some variables to track the "real" desired suspend state of PKL.

If anyone is interested in the code, PM me.

agentwaffle
  • Guests
  • Last active:
  • Joined: --
I am using the colemak version, and I have an issue with AGr key. Since it is an alt key, it accidentally does things like press file in things like notepad. I can get certain other characters to work, I just want to make it so the left alt is only used to allow special chars. Thanks.

agentwaffle
  • Guests
  • Last active:
  • Joined: --
Edit: right, not left alt.

dano
  • Members
  • 4 posts
  • Last active: Oct 07 2010 02:13 PM
  • Joined: 04 Oct 2010
late reply. It seems like the thread is dying. Anyway, when testing notepad on windows 7 if I press and release the alt key, on my US keyboard, It moves the focus to the menu just as if I had pressed only the alt key. On the other hand for mapped keys using altGr when I press the right alt and the desired key I find that the replacement key does appear in the document and focus remains in the document on release of the alt.

I hope this helps.

risingevil
  • Members
  • 42 posts
  • Last active: Oct 14 2011 05:33 PM
  • Joined: 28 Jul 2010
I want to try to learn the Dvorak keyboard using PKL but all I can find is the Colemak and one other on the download site. Am I missing something? Do I have to make my own or something?