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
Pruneau
  • Guests
  • Last active:
  • Joined: --
PKL is extremely convenient! I am using it to run a modified version of the bépo layout.

There is something that I cannot manage to do, and would appreciate pointers: I would like to switch the Enter and Shift keys (this makes sense for me because I have a TypeMatrix keyboard). Everything I have tried leads to bugs. The closest I got was by running a separate AHK script with
RShift::Enter
LShift::Enter
Enter::Shift
Unfortunately, this does not work when I hold the (new) Shift key down: instead of getting ALL CAPS, I get Only one capital.

Any ideas?

bruno
  • Members
  • 635 posts
  • Last active: Nov 04 2015 02:26 PM
  • Joined: 07 Mar 2011
Posted Image I wonder how does the following script figure into this thread? Posted Image

;---- Configuration Section: Customize the size of the on-screen keyboard and
; other options here.

; Changing this font size will make the entire on-screen keyboard get
; larger or smaller:
k_FontSize = 10
k_FontName = Verdana  ; This can be blank to use the system's default font.
k_FontStyle = Bold    ; Example of an alternative: Italic Underline

; Names for the tray menu items:
k_MenuItemHide = Hide on-screen &keyboard
k_MenuItemShow = Show on-screen &keyboard

; To have the keyboard appear on a monitor other than the primary, specify
; a number such as 2 for the following variable.  Leave it blank to use
; the primary:
k_Monitor = 

;---- End of configuration section.  Don't change anything below this point
; unless you want to alter the basic nature of the script.


;---- Alter the tray icon menu:
Menu, Tray, Add, %k_MenuItemHide%, k_ShowHide
Menu, Tray, Add, &Exit, k_MenuExit
Menu, Tray, Default, %k_MenuItemHide%
Menu, Tray, NoStandard

;---- Calculate object dimensions based on chosen font size:
k_KeyWidth = %k_FontSize%
k_KeyWidth *= 3
k_KeyHeight = %k_FontSize%
k_KeyHeight *= 3
k_KeyMargin = %k_FontSize%
k_KeyMargin /= 6
k_SpacebarWidth = %k_FontSize%
k_SpacebarWidth *= 25
k_KeyWidthHalf = %k_KeyWidth%
k_KeyWidthHalf /= 2

k_KeySize = w%k_KeyWidth% h%k_KeyHeight%
k_Position = x+%k_KeyMargin% %k_KeySize%

;---- Create a GUI window for the on-screen keyboard:
Gui, Font, s%k_FontSize% %k_FontStyle%, %k_FontName%
Gui, -Caption +E0x200 +ToolWindow
TransColor = F1ECED
Gui, Color, %TransColor%  ; This color will be made transparent later below.

;---- Add a button for each key. Position the first button with absolute
; coordinates so that all other buttons can be positioned relative to it:
Gui, Add, Button, section %k_KeySize% xm+%k_KeyWidth%, 1
Gui, Add, Button, %k_Position%, 2
Gui, Add, Button, %k_Position%, 3
Gui, Add, Button, %k_Position%, 4
Gui, Add, Button, %k_Position%, 5
Gui, Add, Button, %k_Position%, 6
Gui, Add, Button, %k_Position%, 7
Gui, Add, Button, %k_Position%, 8
Gui, Add, Button, %k_Position%, 9
Gui, Add, Button, %k_Position%, 0
Gui, Add, Button, %k_Position%, -
Gui, Add, Button, %k_Position%, =
Gui, Add, Button, %k_Position%, Bk

Gui, Add, Button, xm y+%k_KeyMargin% h%k_KeyHeight%, Tab  ; Auto-width.
Gui, Add, Button, %k_Position%, Q
Gui, Add, Button, %k_Position%, W
Gui, Add, Button, %k_Position%, E
Gui, Add, Button, %k_Position%, R
Gui, Add, Button, %k_Position%, T
Gui, Add, Button, %k_Position%, Y
Gui, Add, Button, %k_Position%, U
Gui, Add, Button, %k_Position%, I
Gui, Add, Button, %k_Position%, O
Gui, Add, Button, %k_Position%, P
Gui, Add, Button, %k_Position%, [
Gui, Add, Button, %k_Position%, ]
Gui, Add, Button, %k_Position%, \

Gui, Add, Button, xs+%k_KeyWidthHalf% y+%k_KeyMargin% %k_KeySize%, A
Gui, Add, Button, %k_Position%, S
Gui, Add, Button, %k_Position%, D
Gui, Add, Button, %k_Position%, F
Gui, Add, Button, %k_Position%, G
Gui, Add, Button, %k_Position%, H
Gui, Add, Button, %k_Position%, J
Gui, Add, Button, %k_Position%, K
Gui, Add, Button, %k_Position%, L
Gui, Add, Button, %k_Position%, `;
Gui, Add, Button, %k_Position%, '
Gui, Add, Button, x+%k_KeyMargin% h%k_KeyHeight%, Enter  ; Auto-width.

; The first button below adds %A_Space% at the end to widen it a little,
; making the layout of keys next to it more accurately reflect a real keyboard:
Gui, Add, Button, xm y+%k_KeyMargin% h%k_KeyHeight%, Shift%A_Space%%A_Space%
Gui, Add, Button, %k_Position%, Z
Gui, Add, Button, %k_Position%, X
Gui, Add, Button, %k_Position%, C
Gui, Add, Button, %k_Position%, V
Gui, Add, Button, %k_Position%, B
Gui, Add, Button, %k_Position%, N
Gui, Add, Button, %k_Position%, M
Gui, Add, Button, %k_Position%, `,
Gui, Add, Button, %k_Position%, .
Gui, Add, Button, %k_Position%, /

Gui, Add, Button, xm y+%k_KeyMargin% h%k_KeyHeight%, Ctrl  ; Auto-width.
Gui, Add, Button, h%k_KeyHeight% x+%k_KeyMargin%, Win      ; Auto-width.
Gui, Add, Button, h%k_KeyHeight% x+%k_KeyMargin%, Alt      ; Auto-width.
Gui, Add, Button, h%k_KeyHeight% x+%k_KeyMargin% w%k_SpacebarWidth%, Space


;---- Show the window:
Gui, Show
k_IsVisible = y

WinGet, k_ID, ID, A   ; Get its window ID.
WinGetPos,,, k_WindowWidth, k_WindowHeight, A

;---- Position the keyboard at the bottom of the screen (taking into account
; the position of the taskbar):
SysGet, k_WorkArea, MonitorWorkArea, %k_Monitor%

; Calculate window's X-position:
k_WindowX = %k_WorkAreaRight%
k_WindowX -= %k_WorkAreaLeft%  ; Now k_WindowX contains the width of this monitor.
k_WindowX -= %k_WindowWidth%
k_WindowX /= 2  ; Calculate position to center it horizontally.
; The following is done in case the window will be on a non-primary monitor
; or if the taskbar is anchored on the left side of the screen:
k_WindowX += %k_WorkAreaLeft%

; Calculate window's Y-position:
k_WindowY = %k_WorkAreaBottom%
k_WindowY -= %k_WindowHeight%

WinMove, A,, %k_WindowX%, %k_WindowY%
WinSet, AlwaysOnTop, On, ahk_id %k_ID%
WinSet, TransColor, %TransColor% 220, ahk_id %k_ID%


;---- Set all keys as hotkeys. See www.asciitable.com
k_n = 1
k_ASCII = 45

Loop
{
    Transform, k_char, Chr, %k_ASCII%
    StringUpper, k_char, k_char
    if k_char not in <,>,^,~,?,`,
        Hotkey, ~*%k_char%, k_KeyPress
        ; In the above, the asterisk prefix allows the key to be detected regardless
        ; of whether the user is holding down modifier keys such as Control and Shift.
    if k_ASCII = 93
        break
    k_ASCII++
}

return ; End of auto-execute section.


;---- When a key is pressed by the user, click the corresponding button on-screen:

~*Backspace::
ControlClick, Bk, ahk_id %k_ID%, , LEFT, 1, D
KeyWait, Backspace
ControlClick, Bk, ahk_id %k_ID%, , LEFT, 1, U
return


; LShift and RShift are used rather than "Shift" because when used as a hotkey,
; "Shift" would default to firing upon release of the key (in older AHK versions):
~*LShift::
~*RShift::
~*LCtrl::  ; Must use Ctrl not Control to match button names.
~*RCtrl::
~*LAlt::
~*RAlt::
~*LWin::
~*RWin::
StringTrimLeft, k_ThisHotkey, A_ThisHotkey, 3
ControlClick, %k_ThisHotkey%, ahk_id %k_ID%, , LEFT, 1, D
KeyWait, %k_ThisHotkey%
ControlClick, %k_ThisHotkey%, ahk_id %k_ID%, , LEFT, 1, U
return


~*,::
~*'::
~*Space::
~*Enter::
~*Tab::
k_KeyPress:
StringReplace, k_ThisHotkey, A_ThisHotkey, ~
StringReplace, k_ThisHotkey, k_ThisHotkey, *
SetTitleMatchMode, 3  ; Prevents the T and B keys from being confused with Tab and Backspace.
ControlClick, %k_ThisHotkey%, ahk_id %k_ID%, , LEFT, 1, D
KeyWait, %k_ThisHotkey%
ControlClick, %k_ThisHotkey%, ahk_id %k_ID%, , LEFT, 1, U
Return


k_ShowHide:
if k_IsVisible = y
{
    Gui, Cancel
    Menu, Tray, Rename, %k_MenuItemHide%, %k_MenuItemShow%
    k_IsVisible = n
}
else
{
    Gui, Show
    Menu, Tray, Rename, %k_MenuItemShow%, %k_MenuItemHide%
    k_IsVisible = y
}
return


GuiClose:
k_MenuExit:
ExitApp


mlf176f2
  • Members
  • 3 posts
  • Last active: Jan 20 2012 06:45 PM
  • Joined: 16 Jun 2011
I would like to add a half-keyboard support to any keymap. The code is at:

<!-- m -->http://www.autohotke.../topic1326.html<!-- m -->

However, I'm not sure how it fits into your code. If you could provide direction, I can try myself. Its sort of like a dead-key modifier.

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
I think I did that once but I can't remember where I put the code. :)

In my opinion it'd fit in best as an Extend mapping. I use my Extend mappings to provide all sorts of useful hotkeys like Farkas does, so I don't want to use it for a half-keyboard mapping.

My suggestion to Farkas a while back was to allow for multiple Extend layers to provide more functionality (for instance, pressing CapsLock alone would activate the half-keyboard mappings while pressing, say, Alt+CapsLock would activate a hotkey layer), but he hasn't done that and didn't seem interested.
Better burden you cannot carry than man-wisdom much -- Hávamál

mif176f2
  • Guests
  • Last active:
  • Joined: --
How does one use this extended key. Also, can you change the extended key to a space.

Also can you put in your own short-cuts (like mapping ALT-x to something)

andrewed
  • Guests
  • Last active:
  • Joined: --
Hi,

Dvorak and other standalone layouts just aren't here anymore:
http://sourceforge.n... ... 20Layouts/
Where can I find them?

Thanks,
Andrew

mlf176f2
  • Members
  • 3 posts
  • Last active: Jan 20 2012 06:45 PM
  • Joined: 16 Jun 2011
I think you have to create the images, but the layouts are in the svn trunk:


<!-- m -->http://pkl.svn.sourc...vc/pkl/layouts/<!-- m -->

I believe the perl script to create the images is found at

<!-- m -->http://pkl.svn.sourc... ... utilities/<!-- m -->

I believe it may take a specific firefox to run this script though.

maesehn
  • Guests
  • Last active:
  • Joined: --
Hi everyone!
I have a problem and need some help please!
I modified a standard layout to suit my needs in MSKLC about 3 years ago. Then i installed Strawberry-Perl and used the script "klc2ini.pl" to convert the KLC file to the INI file needed by PKL. Everything worked well! (to be honest, i don't remember, but i have the INI file so i guess everything worked well ;)
Last days, i made some mods to this layout in MSKLC so i'd like to update this layout in PKL too! So i installed Strawberry, ran the script and… got this error message:
C:\>perl c:\pkl\utilities\klc2ini.pl
Use of uninitialized value $KLCFILE in open at
        c:\pkl\utilities\klc2ini.pl line 29 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you the
    name of the variable (if any) that was undefined. In some cases it cannot
    do this, so it also tells you what operation you used the undefined value
    in.  Note, however, that perl optimizes your program and the operation
    displayed in the warning may not necessarily appear literally in your
    program.  For example, "that $foo" is usually optimized into "that "
    . $foo, and the warning will refer to the concatenation (.) operator,
    even though there is no . in your program.

Use of uninitialized value $KLCFILE in concatenation (.) or string at
        c:\pkl\utilities\klc2ini.pl line 29 (#1)

Can't open : No such file or directory at c:\pkl\utilities\klc2ini.pl
        line 29 (#2)
    (S inplace) The implicit opening of a file through use of the <>
    filehandle, either implicitly under the -n or -p command-line
    switches, or explicitly, failed for the indicated reason.  Usually this
    is because you don't have read permission for a file which you named on
    the command line.

Uncaught exception from user code:
        Can't open : No such file or directory at c:\pkl\utilities\klc2ini
.pl line 29.
 at c:\pkl\utilities\klc2ini.pl line 29

C:\>
I tried the last portable version of Strawberry (5.12.3.0) on WinXp and Vista, then installed the last version on Vista and finally the version 5.10.1.5 (also available on the welcome page) on Vista, but i get prompted with the same error message each time… :(
I don't know anything about Perl language so i have to admit that i really don't know what to do…
Did someone experienced the same problem? Thanks for your help!

andrewed
  • Guests
  • Last active:
  • Joined: --
Actually no perl is required, I found. Thank god, because I am not a programmer. Here is what is required (from the beginning):

Download Portable_Colemak_v0.3
Unzip it to desktop
Open it
Copy the folder, Portable Keyboard Layout
Paste it to the Desktop
Delete Portable_Colemak_v0.3 (
Open Portable Keyboard Layout>layouts
Create new folder. Entitle it: dvorak
Download dvorak files:
go to: http://pkl.svn.sourc... ... ts/dvorak/
Click on Rev numbers next to file names
the dvorak.klc file will download
the layout.ini code will be displayed with a link to download the file. Click this link.
Copy both these files to your new dvorak folder
Edit the pkl.ini program configuration file
Right click on file (there are two named pkl. The config file is the second one in case you cannot see the file extension names)
Click: Open with...
Select: Notepad
OR:
open notepad
Click File>Open...
in bottom right corner, change "text files" to "all files"
double click pkl.ini configuration file
On line 6 where it reads:
layout = colemak
change "colemak" to "dvorak"
Save file.
Double click pkl application. everything should work.
This will not get you the onscreen layout displays. I don't know how to do that.
*****************
So, that was painful. And incomplete. Until Colemak surpasses Dvorak as the most used alternative keyboard layout, why not just call the download file, "Portable Keyboard Layout" and include both layout folders with the program? Isn't one of the points of being a programmer to eliminate the need for someone else to program something?

How come only 1 in a 100 programmers seems to understand that not everyone lives in the programming bubble?

I think you have to create the images, but the layouts are in the svn trunk:

http://pkl.svn.sourc...vc/pkl/layouts/

I believe the perl script to create the images is found at

http://pkl.svn.sourc... ... utilities/

I believe it may take a specific firefox to run this script though.



andrewed
  • Guests
  • Last active:
  • Joined: --
BTW, thanks mlf176f2 for at least directing me to the necessary files.

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
Andrew: Why on earth did you do all that? Painful for sure...

<!-- m -->http://sourceforge.n... ... ayout/0.3/<!-- m -->

Isn't the Dvorak you need there? So you could just put that in your Layouts folder and be set? Or am I missing something?

Don't expect programmers to cater to your every need, by the way. You're getting your money's worth for this product aren't you? :þ Myself, I wouldn't have bothered to take the UNPAID work hours to make the Dvorak/BEPO/what-have-you layouts for my own program but left that to the Dvorak/etc enthusiasts so you should be grateful instead of whining sarcastically. This isn't a well-supported program of course, but it's still a great gift to the community and that shouldn't be belittled!
Better burden you cannot carry than man-wisdom much -- Hávamál

DreymaR
  • Members
  • 89 posts
  • Last active: Jun 19 2013 08:03 AM
  • Joined: 24 May 2009
Okay, mlfetc - I found my old mirrored keyboard code for PKL! This is for the pkl.ini file (so copy in your preferred [pkl] section from your current pkl.ini file).

[pkl]
; Your usual [PKL] settings go here


[extend]
; These keys are modified/transposed by holding down the 'extend key' (CapsLock by default):


; *** PKL MIRRORED KEYBOARD *** [ this will become an alternate Extend set eventually - ØBG ]
; *** Use the extra section(s) below for backing up any unused Extend set(s)
; *** For now, the -= [] '\ keys remain unmapped; this is as it should be for right-one-handers
; *** Left-one-handers are advised to move the missing punctuation to the middle of the board (67 JL HN)
; *** The apostrophe is so common that it might be best for left-one-handers to remap it to Extend+Tab

; *** ESC/F1-F12
SC001 = SC058
SC03b = SC057
SC03c = SC044
SC03d = SC043
SC03e = SC042
SC03f = SC041
SC040 = SC040
SC041 = SC03f
SC042 = SC03e
SC043 = SC03d
SC044 = SC03c
SC057 = SC03b
SC058 = SC001

; *** Row 1 (numbers/symbols)
SC029 = Backspace
SC002 = 0
SC003 = 9
SC004 = 8
SC005 = 7
SC006 = 6
SC007 = 5
SC008 = 4
SC009 = 3
SC00a = 2
SC00b = 1
SC00c = ``
;SC00d = 
;SC00e = 

; *** Row 2 (upper letter row)
;SC00f = 
SC010 = ;
SC011 = y
SC012 = u
SC013 = l
SC014 = j
SC015 = g
SC016 = p
SC017 = f
SC018 = w
SC019 = q
;SC01a = 
;SC01b = 

; *** Row 3 (home row)
;SC03a = CapsLock
SC01e = o
SC01f = i
SC020 = e
SC021 = n
SC022 = h
SC023 = d
SC024 = t
SC025 = s
SC026 = r
SC027 = a
;SC028 = 
;SC02b = 
;SC01c = Enter

; *** Row 4 (lower letter row)
;SC02a = LShift
; ***** SEE THE [EXTRA] SECTION FOR OPTIONAL 'COMFORT' REGISTRY REMAPPING *****
; Non-registry-mapped 'comfort' layout - VK_102 in the lower left corner is used as 'Z'.
SC056 = /
SC02c = .
SC02d = ,
SC02e = m
SC02f = k
SC030 = ø
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z
; ***** END OF 'COMFORT'/'NON-COMFORT' PART (PASTE BETWEEN THESE LINES) *******
;SC036 = RShift


[Extra_Mirrored_SC]
; *** MIRRORED KEYBOARD *** [ this will become an alternate Extend set eventually ]
; *** Note: In PKL3_0, scan code remapping doesn't work on remapped layouts
; ***       as the resultant SC will be sent back to the WinAPI instead of PKL remapped
; ***       In the future, there should be an option to send the scan code back to PKL

; *** ESC/F1-F12
SC001 = SC058
SC03b = SC057
SC03c = SC044
SC03d = SC043
SC03e = SC042
SC03f = SC041
SC040 = SC040
SC041 = SC03f
SC042 = SC03e
SC043 = SC03d
SC044 = SC03c
SC057 = SC03b
SC058 = SC001

; *** Row 1 (numbers/symbols)
SC029 = SC00e
SC002 = SC00d
SC003 = SC00c
SC004 = SC00b
SC005 = SC00a
SC006 = SC009
SC007 = SC008
SC008 = SC007
SC009 = SC006
SC00a = SC005
SC00b = SC004
SC00c = SC003
SC00d = SC002
SC00e = SC029

; *** Row 2 (upper letter row)
SC00f = SC01b
SC010 = SC01a
SC011 = SC019
SC012 = SC018
SC013 = SC017
SC014 = SC016
SC015 = SC015
SC016 = SC014
SC017 = SC013
SC018 = SC012
SC019 = SC011
SC01a = SC010
SC01b = SC00f

; *** Row 3 (home row)
;SC03a = CapsLock
SC01e = SC02b
SC01f = SC028
SC020 = SC027
SC021 = SC026
SC022 = SC025
SC023 = SC024
SC024 = SC023
SC025 = SC022
SC026 = SC021
SC027 = SC020
SC028 = SC01f
SC02b = SC01e
;SC01c = Enter

; *** Row 4 (lower letter row)
;SC02a = LShift
; ***** SEE THE [EXTRA] SECTION FOR OPTIONAL 'COMFORT' REGISTRY REMAPPING *****
; Non-registry-mapped 'comfort' layout - VK_102 in the lower left corner is used as 'Z'.
SC056 = SC035
SC02c = SC034
SC02d = SC033
SC02e = SC032
SC02f = SC031
SC030 = SC030
SC031 = SC02f
SC032 = SC02e
SC033 = SC02d
SC034 = SC02c
SC035 = SC056
; ***** END OF 'COMFORT'/'NON-COMFORT' PART (PASTE BETWEEN THESE LINES) *******
;SC036 = RShift


[extra]
; This section is not read by the program, but contains snippets for other sections.

; MIRROR Mappings for scan code mapped versus unmapped 'comfort' layout (ZXCVB+VK_102 keys)
; (These keys may already be mapped on a lower level than PKL, by registry)
; Copy the appropriate set into your pkl.ini -> [extend] section, row 4.

; Non-registry-mapped 'comfort' layout - VK_102 in the lower left corner is used as 'Z'.
SC056 = /
SC02c = .
SC02d = ,
SC02e = m
SC02f = k
SC030 = ø
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z

; Non-registry-mapped 'non-comfort' layout - if you have no VK_102 key (or WANT pain?!).
SC02c = /
SC02d = .
SC02e = ,
SC02f = m
SC030 = k
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z

; Scancode/registry mapped 'comfort' layout - VK_102 now sits in the old 'B' position.
SC02c = /
SC02d = .
SC02e = ,
SC02f = m
SC030 = k
SC056 = ø
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z

Now, there are a few quirks in there because I usually go with ergonomic remappings of the lower-left-hand keys and more. But this might set you on the right track at least? If not, ask and we'll figure it out.

More traditional users would want the "Non-registry-mapped 'non-comfort' layout" settings. :)

The great thing about this way of doing it is that it works with any layout! It's not for Colemak or QWERTY or ... it's for all of them. The downside is that since there's only one layer of Extend key remappings I can't use all my cool Extend shortcuts that I've grown addicted to so I don't use mirroring. Had 3-4 Extend layers been possible I might've thrown mirroring in with the other stuff I use.
Better burden you cannot carry than man-wisdom much -- Hávamál

mæsehn
  • Guests
  • Last active:
  • Joined: --
Hi everyone, wanted to give you some updates about my first post:
After a last test with Strawberry 5.10.1.0 (October 2009, probably the version i use 2 years ago (not 3 years as i first said), i actually gave up… :oops:
But today, i tried ActivePerl 5.12.4 and everything worked like a charm! :D
I still don't know what happens with Strawberry but my problem is solved: i'm happy again i can take my (updated) layout everywhere i go!

Biges
  • Members
  • 5 posts
  • Last active: Nov 09 2011 11:04 AM
  • Joined: 07 Nov 2011
Hi!

I'd like to change the current keyboard layout, but I don't know where to start.

What I need to do is to just change a few keys assignment on the Czech QWERTY keyboard. If you could help me with these two keys, I'm sure I'd be able to get the basic working:

Left "+" (1 on the standard US keyboard, SC002) -> ů
Shift + 1 (the same key only with a Shift pressed, SC02A+SC002) -> 1

As you can see I managed how to catch scan codes.

I don't need the on-screen keyboard.

Thanks!

mlf176f2
  • Members
  • 3 posts
  • Last active: Jan 20 2012 06:45 PM
  • Joined: 16 Jun 2011
Thanks!

Okay, mlfetc - I found my old mirrored keyboard code for PKL! This is for the pkl.ini file (so copy in your preferred [pkl] section from your current pkl.ini file).

[pkl]
; Your usual [PKL] settings go here


[extend]
; These keys are modified/transposed by holding down the 'extend key' (CapsLock by default):


; *** PKL MIRRORED KEYBOARD *** [ this will become an alternate Extend set eventually - ØBG ]
; *** Use the extra section(s) below for backing up any unused Extend set(s)
; *** For now, the -= [] '\ keys remain unmapped; this is as it should be for right-one-handers
; *** Left-one-handers are advised to move the missing punctuation to the middle of the board (67 JL HN)
; *** The apostrophe is so common that it might be best for left-one-handers to remap it to Extend+Tab

; *** ESC/F1-F12
SC001 = SC058
SC03b = SC057
SC03c = SC044
SC03d = SC043
SC03e = SC042
SC03f = SC041
SC040 = SC040
SC041 = SC03f
SC042 = SC03e
SC043 = SC03d
SC044 = SC03c
SC057 = SC03b
SC058 = SC001

; *** Row 1 (numbers/symbols)
SC029 = Backspace
SC002 = 0
SC003 = 9
SC004 = 8
SC005 = 7
SC006 = 6
SC007 = 5
SC008 = 4
SC009 = 3
SC00a = 2
SC00b = 1
SC00c = ``
;SC00d = 
;SC00e = 

; *** Row 2 (upper letter row)
;SC00f = 
SC010 = ;
SC011 = y
SC012 = u
SC013 = l
SC014 = j
SC015 = g
SC016 = p
SC017 = f
SC018 = w
SC019 = q
;SC01a = 
;SC01b = 

; *** Row 3 (home row)
;SC03a = CapsLock
SC01e = o
SC01f = i
SC020 = e
SC021 = n
SC022 = h
SC023 = d
SC024 = t
SC025 = s
SC026 = r
SC027 = a
;SC028 = 
;SC02b = 
;SC01c = Enter

; *** Row 4 (lower letter row)
;SC02a = LShift
; ***** SEE THE [EXTRA] SECTION FOR OPTIONAL 'COMFORT' REGISTRY REMAPPING *****
; Non-registry-mapped 'comfort' layout - VK_102 in the lower left corner is used as 'Z'.
SC056 = /
SC02c = .
SC02d = ,
SC02e = m
SC02f = k
SC030 = ø
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z
; ***** END OF 'COMFORT'/'NON-COMFORT' PART (PASTE BETWEEN THESE LINES) *******
;SC036 = RShift


[Extra_Mirrored_SC]
; *** MIRRORED KEYBOARD *** [ this will become an alternate Extend set eventually ]
; *** Note: In PKL3_0, scan code remapping doesn't work on remapped layouts
; ***       as the resultant SC will be sent back to the WinAPI instead of PKL remapped
; ***       In the future, there should be an option to send the scan code back to PKL

; *** ESC/F1-F12
SC001 = SC058
SC03b = SC057
SC03c = SC044
SC03d = SC043
SC03e = SC042
SC03f = SC041
SC040 = SC040
SC041 = SC03f
SC042 = SC03e
SC043 = SC03d
SC044 = SC03c
SC057 = SC03b
SC058 = SC001

; *** Row 1 (numbers/symbols)
SC029 = SC00e
SC002 = SC00d
SC003 = SC00c
SC004 = SC00b
SC005 = SC00a
SC006 = SC009
SC007 = SC008
SC008 = SC007
SC009 = SC006
SC00a = SC005
SC00b = SC004
SC00c = SC003
SC00d = SC002
SC00e = SC029

; *** Row 2 (upper letter row)
SC00f = SC01b
SC010 = SC01a
SC011 = SC019
SC012 = SC018
SC013 = SC017
SC014 = SC016
SC015 = SC015
SC016 = SC014
SC017 = SC013
SC018 = SC012
SC019 = SC011
SC01a = SC010
SC01b = SC00f

; *** Row 3 (home row)
;SC03a = CapsLock
SC01e = SC02b
SC01f = SC028
SC020 = SC027
SC021 = SC026
SC022 = SC025
SC023 = SC024
SC024 = SC023
SC025 = SC022
SC026 = SC021
SC027 = SC020
SC028 = SC01f
SC02b = SC01e
;SC01c = Enter

; *** Row 4 (lower letter row)
;SC02a = LShift
; ***** SEE THE [EXTRA] SECTION FOR OPTIONAL 'COMFORT' REGISTRY REMAPPING *****
; Non-registry-mapped 'comfort' layout - VK_102 in the lower left corner is used as 'Z'.
SC056 = SC035
SC02c = SC034
SC02d = SC033
SC02e = SC032
SC02f = SC031
SC030 = SC030
SC031 = SC02f
SC032 = SC02e
SC033 = SC02d
SC034 = SC02c
SC035 = SC056
; ***** END OF 'COMFORT'/'NON-COMFORT' PART (PASTE BETWEEN THESE LINES) *******
;SC036 = RShift


[extra]
; This section is not read by the program, but contains snippets for other sections.

; MIRROR Mappings for scan code mapped versus unmapped 'comfort' layout (ZXCVB+VK_102 keys)
; (These keys may already be mapped on a lower level than PKL, by registry)
; Copy the appropriate set into your pkl.ini -> [extend] section, row 4.

; Non-registry-mapped 'comfort' layout - VK_102 in the lower left corner is used as 'Z'.
SC056 = /
SC02c = .
SC02d = ,
SC02e = m
SC02f = k
SC030 = ø
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z

; Non-registry-mapped 'non-comfort' layout - if you have no VK_102 key (or WANT pain?!).
SC02c = /
SC02d = .
SC02e = ,
SC02f = m
SC030 = k
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z

; Scancode/registry mapped 'comfort' layout - VK_102 now sits in the old 'B' position.
SC02c = /
SC02d = .
SC02e = ,
SC02f = m
SC030 = k
SC056 = ø
SC031 = b
SC032 = v
SC033 = c
SC034 = x
SC035 = z

Now, there are a few quirks in there because I usually go with ergonomic remappings of the lower-left-hand keys and more. But this might set you on the right track at least? If not, ask and we'll figure it out.

More traditional users would want the "Non-registry-mapped 'non-comfort' layout" settings. :)

The great thing about this way of doing it is that it works with any layout! It's not for Colemak or QWERTY or ... it's for all of them. The downside is that since there's only one layer of Extend key remappings I can't use all my cool Extend shortcuts that I've grown addicted to so I don't use mirroring. Had 3-4 Extend layers been possible I might've thrown mirroring in with the other stuff I use.