After using PKL for a while I think it lacks Qwerty shortcuts. I've edited pkl_main.ahk file and it's easily achievable! The method is perfectly easy. Every time you press Ctrl, Alt or Win key (not AltGr) it suspends the script giving you access to your standard layout shortcuts! Try it out yourself!
You will need source code of pkl from here:
http://sourceforge.net/projects/pkl/fil ... p/download
and the edited version of pkl_main.ahk:
Code:
#NoEnv
#Persistent
#NoTrayIcon
#InstallKeybdHook
#SingleInstance force
#MaxThreadsBuffer
#MaxThreadsPerHotkey 3
#MaxHotkeysPerInterval 300
#MaxThreads 20
setPklInfo( "version", "0.3" )
setPklInfo( "compiled", "2008.09.01." )
SendMode Event
SetBatchLines, -1
Process, Priority, , H
Process, Priority, , R
SetWorkingDir, %A_ScriptDir%
; Global variables
CurrentDeadKeys = 0 ; How many dead key were pressed
CurrentBaseKey = 0 ; Current base key :)
TheLoop = 1
t = %1% ; Layout from command line parameter
pkl_init( t )
pkl_activate()
; ####################### the loop #######################
Loop ; This loop suspends the script when you press Control, Alt or Win key (giving you Qwerty shortcuts).
{
If TheLoop = 1
{
If (!GetKeyState("Control")
and !GetKeyState("Alt")
and !GetKeyState("LWin")
and !GetKeyState("RWin"))
{
Gosub, SuspendOff
}
else
{
If !GetKeyState("RAlt") ; prevents from suspending if it was AltGr pressed
gosub, SuspendOn
}
}
Sleep, 50
}
return
; ####################### labels #######################
exitApp:
exitApp
return
detectDeadKeysInCurrentLayout:
setDeadKeysInCurrentLayout( detectDeadKeysInCurrentLayout() )
return
processKeyPress0:
processKeyPress1:
processKeyPress2:
processKeyPress3:
processKeyPress4:
processKeyPress5:
processKeyPress6:
processKeyPress7:
processKeyPress8:
processKeyPress9:
processKeyPress10:
processKeyPress11:
processKeyPress12:
processKeyPress13:
processKeyPress14:
processKeyPress15:
processKeyPress16:
processKeyPress17:
processKeyPress18:
processKeyPress19:
processKeyPress20:
processKeyPress21:
processKeyPress22:
processKeyPress23:
processKeyPress24:
processKeyPress25:
processKeyPress26:
processKeyPress27:
processKeyPress28:
processKeyPress29:
runKeyPress()
return
keyPressedwoStar: ; SC025
activity_ping()
Critical
ThisHotkey := A_ThisHotkey
processKeyPress( ThisHotkey )
return
keyPressed: ; *SC025
activity_ping()
Critical
ThisHotkey := substr( A_ThisHotkey, 2 )
processKeyPress( ThisHotkey )
return
upToDownKeyPress: ; *SC025 UP
activity_ping()
Critical
ThisHotkey := A_ThisHotkey
ThisHotkey := substr( ThisHotkey, 2 )
ThisHotkey := substr( ThisHotkey, 1, -3 )
processKeyPress( ThisHotkey )
return
modifierDown: ; *SC025
activity_ping()
Critical
ThisHotkey := substr( A_ThisHotkey, 2 )
setModifierState( getLayoutItem( ThisHotkey . "v" ), 1 )
return
modifierUp: ; *SC025 UP
activity_ping()
Critical
ThisHotkey := A_ThisHotkey
ThisHotkey := substr( ThisHotkey, 2 )
ThisHotkey := substr( ThisHotkey, 1, -3 )
setModifierState( getLayoutItem( ThisHotkey . "v" ), 0 )
return
ShowAbout:
pkl_about()
return
displayHelpImage:
pkl_displayHelpImage()
return
displayHelpImageToggle:
pkl_displayHelpImage( 2 )
return
changeTheActiveLayout:
changeLayout( getLayoutInfo( "nextLayout" ) )
return
changeLayoutMenu:
changeLayout( getLayoutInfo( "layout" . A_ThisMenuItemPos . "code" ) )
return
doNothing:
return
ToggleSuspend:
Suspend
If TheLoop
TheLoop = 0
else
TheLoop = 1
gosub, SuspendSub
return
SuspendSub:
if ( A_IsSuspended ) {
pkl_displayHelpImage( 3 )
Menu, tray, Icon, % getTrayIconInfo( "FileOff" ), % getTrayIconInfo( "NumOff" )
} else {
activity_ping( 1 )
activity_ping( 2 )
pkl_displayHelpImage( 4 )
Menu, tray, Icon, % getTrayIconInfo( "FileOn" ), % getTrayIconInfo( "NumOn" )
}
return
SuspendOn:
Suspend, On
gosub, SuspendSub
return
SuspendOff:
Suspend, Off
gosub, SuspendSub
return
; ####################### functions #######################
#Include pkl_deadkey.ahk
#Include pkl_getset.ahk
#Include pkl_gui.ahk
#Include pkl_init.ahk
#Include pkl_keypress.ahk
#Include pkl_locale.ahk
#Include pkl_send.ahk
#Include pkl_activity.ahk
; ####################### (external) modules #######################
#Include HexUC.ahk ; Written by Laszlo Hars
#Include MI.ahk ; http://www.autohotkey.com/forum/viewtopic.php?t=21991
#Include Ini.ahk ; http://www.autohotkey.net/~majkinetor/Ini/Ini.ahk
#Include SendU.ahk
#Include getGlobal.ahk
#Include HashTable.ahk
#Include iniReadBoolean.ahk
#Include detectDeadKeysInCurrentLayout.ahk
#Include virtualKeyCodeFromName.ahk
#Include getDeadKeysOfSystemsActiveLayout.ahk
#Include getLanguageStringFromDigits.ahk ; http://www.autohotkey.com/docs/misc/Languages.htm
The changes are: new variable (TheLoop), continuous loop at the beginning of the script and some other changes in Suspend label.
Simply copy-paste this into your \source\pkl_main.ahk file and replace all the content there.
Have fun!
Cheers,
Long Bong.