 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ezuk
Joined: 04 Jun 2005 Posts: 146
|
Posted: Mon Sep 14, 2009 6:38 am Post subject: |
|
|
| This is truly fantastic, Shaun. I've been waiting for something like this for a long long time. Awesome! |
|
| Back to top |
|
 |
sutari Guest
|
Posted: Tue Feb 16, 2010 5:52 pm Post subject: |
|
|
Hi this is great, now I can map my keyboard without microsoft drivers. The only thing is that is a problem now is I am so new to AHK that I do not understand the script. If anyone can help me out here would be great. I want to map zoom slider to "[" "]" keys on the keyboard.
thanks |
|
| Back to top |
|
 |
mai9
Joined: 17 Mar 2008 Posts: 62 Location: Barcelona, Catalonia
|
Posted: Sun Jul 18, 2010 2:58 am Post subject: |
|
|
| sutari wrote: | Hi this is great, now I can map my keyboard without microsoft drivers. The only thing is that is a problem now is I am so new to AHK that I do not understand the script. If anyone can help me out here would be great. I want to map zoom slider to "[" "]" keys on the keyboard.
thanks |
hi sutari, I don't know much about AutoHotkey (and I don't know if you'll read this after 4 months), but I think that this code will do what you want, although the zoom slider is not suposed to send normal keys as the hardware sends repeated strokes.
| Code: |
; Capture input from the "Zoom" slider on the Natural Keyboard 4000
; and use it to scroll up and scroll down
; The HID top level collection for the Natural Keyboard 4000 is:
; Usage 1
; Usage Page 12
#NoTrayIcon
; Replace any previous instance
#SingleInstance force
DetectHiddenWindows, on
OnMessage(0x00FF, "InputMessage")
SizeofRawInputDeviceList := 8
SizeofRidDeviceInfo := 32
RIM_TYPEMOUSE := 0
RIM_TYPEKEYBOARD := 1
RIM_TYPEHID := 2
RIDI_DEVICENAME := 0x20000007
RIDI_DEVICEINFO := 0x2000000b
RIDEV_INPUTSINK := 0x00000100
RID_INPUT := 0x10000003
Usage := 1
UsagePage := 12
Gui, Show, Hide, NaturalCapture
HWND := WinExist("NaturalCapture")
; Keyboards are always Usage 6, Usage Page 1, Mice are Usage 2, Usage Page 1,
; HID devices specify their top level collection in the info block
VarSetCapacity(RawDevice, 12)
NumPut(RIDEV_INPUTSINK, RawDevice, 4)
NumPut(HWND, RawDevice, 8)
NumPut(UsagePage, RawDevice, 0, "UShort")
NumPut(Usage, RawDevice, 2, "UShort")
Res := DllCall("RegisterRawInputDevices", "UInt", &RawDevice, UInt, 1, UInt, 12)
if (Res = 0)
MsgBox, Failed to register for Natural Keyboard
InputMessage(wParam, lParam, msg, hwnd)
{
global DoCapture
global RIM_TYPEMOUSE, RIM_TYPEKEYBOARD, RIM_TYPEHID
global RID_INPUT
if (DoCapture = 0)
return
Res := DllCall("GetRawInputData", UInt, lParam, UInt, RID_INPUT, UInt, 0, "UInt *", Size, UInt, 16)
VarSetCapacity(Buffer, Size)
Res := DllCall("GetRawInputData", UInt, lParam, UInt, RID_INPUT, UInt, &Buffer, "UInt *", Size, UInt, 16)
Type := NumGet(Buffer, 0 * 4)
Size := NumGet(Buffer, 1 * 4)
Handle := NumGet(Buffer, 2 * 4)
;AppendOutput("Got Input with " . Res . " size " . Size . " Type " . Type . " Handle " . Handle . "`r`n")
if (Type = RIM_TYPEHID)
{
SizeHid := NumGet(Buffer, (16 + 0))
InputCount := NumGet(Buffer, (16 + 4))
;Debug("HND " . Handle . " HID Size " . SizeHid . " Count " . InputCount . " Ptr " . &Buffer . "`r`n")
Loop %InputCount% {
Addr := &Buffer + 24 + ((A_Index - 1) * SizeHid)
BAddr := &Buffer
;MsgBox, BAddr %BAddr% Addr %Addr%
Input := Mem2Hex(Addr, SizeHid)
;Debug("Input " . Input . "`r`n")
if (IsLabel(Input))
Gosub, %Input%
}
}
return
}
return
Exit
GuiClose:
ExitApp
; 1 = UP, 2 = DOWN
ScrollDir := 0
DoScroll:
ControlGetFocus, fcontrol, A
; WM_VSCROLL = 0x115, SB_LINEUP = 0, SB_LINEDOWN = 1
WinGetClass, ClassName, A
;Debug("Class " . ClassName)
if (InStr(ClassName, "Mozilla"))
{
IsMozilla := 1
}
else
{
IsMozilla := 0
}
Loop 1 {
if (ScrollDir = 1)
{
if (IsMozilla)
SendInput, {Up}
else
Send [
}
else
{
if (IsMozilla)
SendInput, {Down}
else
Send ]
}
}
;Debug("Done")
Return
; Zoom down
012E020000010000:
ScrollDir := 2
GoSub, DoScroll
SetTimer, DoScroll, 1080
return
; Zoom up
012D020000010000:
ScrollDir := 1
GoSub, DoScroll
SetTimer, DoScroll, 1080
return
; All up
0100000000010000:
ScrollDir := 0
SetTimer, DoScroll, Off
return
Debug(msg)
{
OutputDebug, %msg%
return
}
Mem2Hex( pointer, len )
{
A_FI := A_FormatInteger
SetFormat, Integer, Hex
Loop, %len% {
Hex := *Pointer+0
StringReplace, Hex, Hex, 0x, 0x0
StringRight Hex, Hex, 2
hexDump := hexDump . hex
Pointer ++
}
SetFormat, Integer, %A_FI%
StringUpper, hexDump, hexDump
Return hexDump
} |
What I did is remove the loop so it only sends one keystroke and increase the timer so it takes a long time to send two keystrokes. It still scrolls on Mozilla, you can eliminate that if you want. |
|
| Back to top |
|
 |
fenderist
Joined: 14 Jul 2010 Posts: 5
|
Posted: Tue Aug 03, 2010 3:02 am Post subject: Remapping arrow into favorite keys |
|
|
First of all, thank you so much for this thread!
Well, when I remap the arrow keys into favorite keys, I can get the navigation correctly (i.e. word processor), but when I try it with shortcut keys, it does not work. For example, Win+Left will not give me the half screen in Windows 7.
I can remap left key into 'b' like this
| Code: | | *b::SendInput {Blind}{Right} |
and it works, but if I do
| Code: | ; Favorites 2
0100000000090000:
SendInput {Blind}{Left}
return |
it does not work. Is there any way to key around this problem? |
|
| Back to top |
|
 |
blablaman1
Joined: 31 Oct 2010 Posts: 2
|
Posted: Sun Oct 31, 2010 2:08 pm Post subject: |
|
|
this is awesome! Thank you very much. I've tamed my MS keyboard horse )
But actually I've spent a few hours for that... And the problem was DLL calls you use do not work under win7x64 if you install 64-bit version of autohotkey... But discovering that took me whole life...
But now It is ok. I do not remap all the extra keys - I use intelliType too (but disabled remapped keys, otherwise events duplicate each other and do double work). Remapped keys are very clever now =) for example, My Favorites launches Total Commander if it is not launched or brings to front if it exist. So do PlayPause button with aimp.
| Code: |
; My Favorites
0182010000010000:
If WinExist("ahk_class TTOTAL_CMD")
WinActivate ; use the window found above
else
Run d:\distrib\TotalCommander\Totalcmd7\LaunchTC.lnk
|
| Code: |
; Play-Pause button
01CD000000010000:
If WinExist("ahk_class TAIMP2MainW")
{
Send ^!+p ; this is my AIMP's global hot key - CtrlAltShiftP
}
else
{
Run d:\distrib\AIMP\AIMP2\AIMP2.exe
while !(WinExist("ahk_class TAIMP2MainW"))
{
Sleep 333
}
Sleep 999
Send ^!+p
}
|
To find out this key code 01CD000000010000 I have to use VMWare and WinXP 32 bit (this is how I've managed to run all these scripts at all including AHKHID http://www.autohotkey.com/forum/viewtopic.php?t=41397&postdays=0&postorder=asc&start=0&sid=50f1db59ff47df330e4905910226214f |
|
| Back to top |
|
 |
blablaman11 Guest
|
Posted: Sun Oct 31, 2010 6:03 pm Post subject: |
|
|
| wow I can not reproduce catching codes for special buttons =(( I mean favorites keys and other extra. I use vmware and WinXP, I use my win7x64 and autohotkey in all of them... different versions of autohotkey. Just do not know what to do ))) |
|
| Back to top |
|
 |
blablaman1
Joined: 31 Oct 2010 Posts: 2
|
Posted: Sun Oct 31, 2010 6:23 pm Post subject: |
|
|
oh I have just misplaced usage and usage page.
Use AHKHID example 2 and type 12 as usage page and 1 as usage. Then you will be able to catch ms natural 4000 extra buttons |
|
| Back to top |
|
 |
mai9
Joined: 17 Mar 2008 Posts: 62 Location: Barcelona, Catalonia
|
Posted: Sat Jan 15, 2011 1:29 pm Post subject: |
|
|
| blablaman1 wrote: | | the problem was DLL calls you use do not work under win7x64 if you install 64-bit version of autohotkey... But discovering that took me whole life... |
I also found that the script doesn't work when using the new AutoHotkey_L v1.0.92.00. What should we do? Does anybody know how to fix it?
When I load the script it says "Failed to register for Natural Keyboard".  |
|
| Back to top |
|
 |
Kuklakot Guest
|
Posted: Tue Apr 05, 2011 7:35 pm Post subject: |
|
|
OK, so I butchered the original script a little to adapt it for x64 platform. The problem was with the fact that Windows pointer types became twice as big in x64 so the original structs didn't fit the actual messages. NumGet is also platform sensitive so the data sizes need to be stated explicitly in every call. I also tried to get rid of all the "magic numbers" in the original code to improve readability a little.
| Code: |
; Capture input from the "Zoom" slider on the Natural Keyboard 4000
; and use it to scroll up and scroll down
; The HID top level collection for the Natural Keyboard 4000 is:
; Usage 1
; Usage Page 12
#NoTrayIcon
; Replace any previous instance
#SingleInstance force
C(str) ; const container
{
return, (%str%)
static MS_SHORT := 2
static MS_DWORD := 4
static MS_PTR := 8 ;x64 specific
static SizeofRawInputDevice := MS_SHORT*2 + MS_DWORD + MS_PTR
/*
typedef struct tagRAWINPUTDEVICE {
USHORT usUsagePage;
USHORT usUsage;
DWORD dwFlags;
HWND hwndTarget;
} RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;
*/
static SizeofRawInputDataHeader := MS_DWORD*2 + MS_PTR*2
/*
typedef struct tagRAWINPUTHEADER {
DWORD dwType;
DWORD dwSize;
HANDLE hDevice;
WPARAM wParam;
} RAWINPUTHEADER, *PRAWINPUTHEADER;
*/
static RIM_TYPEMOUSE := 0
static RIM_TYPEKEYBOARD := 1
static RIM_TYPEHID := 2
static RIDI_DEVICENAME := 0x20000007
static RIDI_DEVICEINFO := 0x2000000b
static RIDEV_INPUTSINK := 0x00000100 ; receive in foreground
static RID_INPUT := 0x10000003 ; request header
; Keyboards are always Usage 6, Usage Page 1, Mice are Usage 2, Usage Page 1,
; HID devices specify their top level collection in the info block
static Usage := 1
static UsagePage := 12
}
HID_Input_Init:
{
DetectHiddenWindows, on
OnMessage(0x00FF, "InputMessage")
Gui, Show, Hide, NaturalCapture
HWND := WinExist("NaturalCapture")
VarSetCapacity(RawInputDevice, C("SizeofRawInputDevice"))
NumPut(C("UsagePage"), RawInputDevice, 0)
NumPut(C("Usage"), RawInputDevice, C("MS_SHORT"))
NumPut(C("RIDEV_INPUTSINK"), RawInputDevice, C("MS_SHORT")*2)
NumPut(HWND, RawInputDevice, C("MS_SHORT")*2 + C("MS_DWORD"))
Res := DllCall("RegisterRawInputDevices", "UInt", &RawInputDevice, UInt, 1, UInt, C("SizeofRawInputDevice"))
if (Res = 0)
MsgBox, Failed to register for Natural Keyboard
return
}
InputMessage(wParam, lParam, msg, hwnd)
{
Res := DllCall("GetRawInputData", UInt, lParam, UInt, C("RID_INPUT"), UInt, 0, "UInt *", Size, UInt, C("SizeofRawInputDataHeader"))
VarSetCapacity(RawInputData, Size)
Res := DllCall("GetRawInputData", UInt, lParam, UInt, C("RID_INPUT"), UInt, &RawInputData, "UInt *", Size, UInt, C("SizeofRawInputDataHeader"))
SetFormat, Integer, Hex
Type := NumGet(RawInputData, 0, "UInt")
Size := NumGet(RawInputData, 1 * C("MS_DWORD"), "UInt")
Handle := NumGet(RawInputData, 2 * C("MS_DWORD"), "UInt64") ; x64 specific
if (Type = C("RIM_TYPEHID"))
{
SizeHid := NumGet(RawInputData, (C("SizeofRawInputDataHeader") + 0), "UInt")
InputCount := NumGet(RawInputData, (C("SizeofRawInputDataHeader") + C("MS_DWORD")), "UInt")
Loop %InputCount% {
Addr := &RawInputData + C("SizeofRawInputDataHeader") + C("MS_DWORD")*2 + ((A_Index - 1) * SizeHid)
BAddr := &RawInputData
Input := Mem2Hex(Addr, SizeHid)
;MsgBox, %Input%
/*
if (Input != 0100000000010000 && Input != 0100000000000000)
{
SoundPlay, *64
clipboard = %clipboard%`r`n%Input%
}
*/
if (IsLabel(Input))
Gosub, %Input%
}
}
else
return
}
Scroll:
{
if (ScrollDirection == 1)
{
SendInput, {up}
}
else if (ScrollDirection == 2)
{
SendInput, {down}
}
return
}
; Zoom up
012D020000010000:
ScrollDirection := 1
GoSub Scroll
SetTimer, Scroll, 50
return
; Zoom down
012E020000010000:
ScrollDirection := 2
GoSub Scroll
SetTimer, Scroll, 50
return
; All up
0100000000010000:
ScrollDirection := 0
SetTimer, Scroll, Off
return
Mem2Hex(pointer, len)
{
A_FI := A_FormatInteger
SetFormat, Integer, Hex
Loop, %len% {
Hex := *Pointer+0
StringReplace, Hex, Hex, 0x, 0x0
StringRight Hex, Hex, 2
hexDump := hexDump . hex
Pointer ++
}
SetFormat, Integer, %A_FI%
StringUpper, hexDump, hexDump
Return hexDump
}
|
|
|
| Back to top |
|
 |
Silion Guest
|
Posted: Sat May 14, 2011 2:38 pm Post subject: |
|
|
Kuklakot you are my hero
I don't like using up and down as scrolling though so here is my take on it (plus a few hotkeys and different keycodes)
| Code: |
; Capture input from the "Zoom" slider on the Natural Keyboard 4000
; and use it to scroll up and scroll down
; The HID top level collection for the Natural Keyboard 4000 is:
; Usage 1
; Usage Page 12
#NoTrayIcon
; Replace any previous instance
#SingleInstance force
C(str) ; const container
{
return, (%str%)
static MS_SHORT := 2
static MS_DWORD := 4
static MS_PTR := 8 ;x64 specific
static SizeofRawInputDevice := MS_SHORT*2 + MS_DWORD + MS_PTR
/*
typedef struct tagRAWINPUTDEVICE {
USHORT usUsagePage;
USHORT usUsage;
DWORD dwFlags;
HWND hwndTarget;
} RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;
*/
static SizeofRawInputDataHeader := MS_DWORD*2 + MS_PTR*2
/*
typedef struct tagRAWINPUTHEADER {
DWORD dwType;
DWORD dwSize;
HANDLE hDevice;
WPARAM wParam;
} RAWINPUTHEADER, *PRAWINPUTHEADER;
*/
static RIM_TYPEMOUSE := 0
static RIM_TYPEKEYBOARD := 1
static RIM_TYPEHID := 2
static RIDI_DEVICENAME := 0x20000007
static RIDI_DEVICEINFO := 0x2000000b
static RIDEV_INPUTSINK := 0x00000100 ; receive in foreground
static RID_INPUT := 0x10000003 ; request header
; Keyboards are always Usage 6, Usage Page 1, Mice are Usage 2, Usage Page 1,
; HID devices specify their top level collection in the info block
static Usage := 1
static UsagePage := 12
}
HID_Input_Init:
{
DetectHiddenWindows, on
OnMessage(0x00FF, "InputMessage")
Gui, Show, Hide, NaturalCapture
HWND := WinExist("NaturalCapture")
VarSetCapacity(RawInputDevice, C("SizeofRawInputDevice"))
NumPut(C("UsagePage"), RawInputDevice, 0)
NumPut(C("Usage"), RawInputDevice, C("MS_SHORT"))
NumPut(C("RIDEV_INPUTSINK"), RawInputDevice, C("MS_SHORT")*2)
NumPut(HWND, RawInputDevice, C("MS_SHORT")*2 + C("MS_DWORD"))
Res := DllCall("RegisterRawInputDevices", "UInt", &RawInputDevice, UInt, 1, UInt, C("SizeofRawInputDevice"))
if (Res = 0)
MsgBox, Failed to register for Natural Keyboard
return
}
InputMessage(wParam, lParam, msg, hwnd)
{
Res := DllCall("GetRawInputData", UInt, lParam, UInt, C("RID_INPUT"), UInt, 0, "UInt *", Size, UInt, C("SizeofRawInputDataHeader"))
VarSetCapacity(RawInputData, Size)
Res := DllCall("GetRawInputData", UInt, lParam, UInt, C("RID_INPUT"), UInt, &RawInputData, "UInt *", Size, UInt, C("SizeofRawInputDataHeader"))
SetFormat, Integer, Hex
Type := NumGet(RawInputData, 0, "UInt")
Size := NumGet(RawInputData, 1 * C("MS_DWORD"), "UInt")
Handle := NumGet(RawInputData, 2 * C("MS_DWORD"), "UInt64") ; x64 specific
if (Type = C("RIM_TYPEHID"))
{
SizeHid := NumGet(RawInputData, (C("SizeofRawInputDataHeader") + 0), "UInt")
InputCount := NumGet(RawInputData, (C("SizeofRawInputDataHeader") + C("MS_DWORD")), "UInt")
Loop %InputCount% {
Addr := &RawInputData + C("SizeofRawInputDataHeader") + C("MS_DWORD")*2 + ((A_Index - 1) * SizeHid)
BAddr := &RawInputData
Input := Mem2Hex(Addr, SizeHid)
;MsgBox, %Input%
/*
if (Input != 0100000000010000 && Input != 0100000000000000)
{
SoundPlay, *64
clipboard = %clipboard%`r`n%Input%
}
*/
if (IsLabel(Input))
Gosub, %Input%
}
}
else
return
}
; 1 = UP, 2 = DOWN
ScrollDir := 0
DoScroll:
ControlGetFocus, fcontrol, A
; WM_VSCROLL = 0x115, SB_LINEUP = 0, SB_LINEDOWN = 1
Loop 1
{
if (ScrollDir = 1)
SendInput, {WheelUp}
else
SendInput, {WheelDown}
}
Return
; // Special Keys //
; ++ Function Keys ++
; Function Key "="
0100006700000000:
Send {=}
return
; Function Key "("
010000B600000000:
Send {(}
return
; Function Key ")"
010000B700000000:
Send {)}
return
; ++ Favorites Keys ++
; Favorites 1
0100000000040000:
Send {)}
return
; Favorites 2
0100000000080000:
Send {)}
return
; Favorites 3
0100000000100000:
Send {)}
return
; Favorites 4
0100000000200000:
Send {)}
return
; Favorites 5
0100000000400000:
Run "C:\Program Files\uTorrent\utorrent.exe"
return
; My Favorites
0182010000000000:
Run "C:\Program Files\uTorrent\utorrent.exe"
return
; ++ Media Keys ++
; Play/Pause
01CD000000000000:
If WinExist("ahk_class XMPLAY-MAIN")
ControlSend, , {Media_Play_Pause}, ahk_class XMPLAY-MAIN
else
{
Run "D:\Archiwum\Programy\Inne\Music Players\XMPlay\XMPlay.exe"
while !(WinExist("ahk_class XMPLAY-MAIN"))
Sleep 333
Sleep 999
ControlSend, , {Media_Play_Pause}, ahk_class XMPLAY-MAIN
}
return
; Calculator
0192010000000000:
Run "D:\Archiwum\Programy\System\Narzedzia\Windows7-calculator\Calc.exe"
return
; ++ Zoom/Scroll Keys ++
; Zoom Down
012E020000000000:
ScrollDir := 2
GoSub, DoScroll
SetTimer, DoScroll, 80
return
; Zoom Up
012D020000000000:
ScrollDir := 1
GoSub, DoScroll
SetTimer, DoScroll, 80
return
; All up
0100000000000000:
ScrollDir := 0
SetTimer, DoScroll, Off
return
; ++ Standard Special Keys ++
Launch_Mail::Run "C:\Program Files (x86)\Mozilla\Thunderbird\thunderbird.exe"
Browser_Search::Run "C:\Program Files (x86)\Avira\AntiVir Desktop\avscan.exe" /GUIMODE=1 /PATH="c:\"
Browser_Home::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 1, "int", 0)
; // Combinations //
^PgUp::ControlSend, , ^{PgUp}, ahk_class XMPLAY-MAIN
^PgDn::ControlSend, , ^{PgDn}, ahk_class XMPLAY-MAIN
^End::ControlSend, , ^{End}, ahk_class XMPLAY-MAIN
; // Buttons Customized for Applications //
if (InStr(ClassName, "Mozilla") or InStr(ClassName, "Opera"))
Browser_Forward::^Right
Debug(msg)
{
OutputDebug, %msg%
return
}
Mem2Hex( pointer, len )
{
A_FI := A_FormatInteger
SetFormat, Integer, Hex
Loop, %len%
{
Hex := *Pointer+0
StringReplace, Hex, Hex, 0x, 0x0
StringRight Hex, Hex, 2
hexDump := hexDump . hex
Pointer ++
}
SetFormat, Integer, %A_FI%
StringUpper, hexDump, hexDump
Return hexDump
}
|
|
|
| Back to top |
|
 |
xpanta
Joined: 16 Nov 2011 Posts: 5
|
Posted: Thu Nov 17, 2011 9:13 am Post subject: |
|
|
Hi, I am trying to use the script and I get this error message:
| Quote: | Warning: Local variable with same name as global.
Specifically: Res (in function InputMessage)
|
I use AutoHotKey_L and I haven't loaded the IntelliType Driver.
The script is not loaded (although problem is a Warning and not an Error)
Any ideas what am I doing wrong?
EDIT: Sorry, the script is actually loaded but the icon is not shown. I can tell this because I have remapped some keys to skip to next and previous media track and it works. However, zoom button is not responding |
|
| Back to top |
|
 |
CircuitryMaker
Joined: 28 Jan 2006 Posts: 88 Location: Germany
|
Posted: Thu Dec 22, 2011 9:39 pm Post subject: |
|
|
Very useful script. One thing to add:
0100000000010000 means that no key is pressed.
If you want to find out when Key <insert single key here> was released you have to write into a variable, which one was used. This can be quite annoying with many hotkeys. Can you add a workaround so you know which key was released in addition to no key being pressed. |
|
| Back to top |
|
 |
automaticman
Joined: 27 Oct 2006 Posts: 648
|
Posted: Wed Feb 01, 2012 4:14 pm Post subject: |
|
|
How can we find out those strings for the various labels?
| Code: | Zoom down
012E020000010000: |
|
|
| Back to top |
|
 |
Philister
Joined: 12 Feb 2012 Posts: 2
|
Posted: Sun Feb 12, 2012 8:20 am Post subject: Remapping F-Lock |
|
|
@automaticman: You have to use the first script posted in this thread. Copy the code into an .ahk file and run it. Click on "Capture on" button and press the key you need. Click on "Capture off" and copy the information. Voila.
If anyone wants to script the F-Lock key, several changes need to be made as its status changes the messages sent by many of the other special keys. Here is what I use in my script:
| Code: | ; Zoom down
012E020000000000:
012E020000010000:
ScrollDir := 2
GoSub, DoScroll
SetTimer, DoScroll, 80
return
; Zoom up
012D020000000000:
012D020000010000:
ScrollDir := 1
GoSub, DoScroll
SetTimer, DoScroll, 80
return
; All up
0100000000000000:
0100000000010000:
ScrollDir := 0
SetTimer, DoScroll, Off
return
;numpad=
0100006700000000:
0100006700010000:
msgbox equal
return
;numpad(
010000B600000000:
010000B600010000:
msgbox (
return
;numpad)
010000B700000000:
010000B700010000:
msgbox )
return
; My Favorites
0182010000000000:
0182010000010000:
MsgBox My Favorites Button
return
; Favorites 1
0100000000040000:
0100000000050000:
MsgBox Favorites 1
return
; Favorites 2
0100000000080000:
0100000000090000:
MsgBox Favorites 2
return
; Favorites 3
0100000000100000:
0100000000110000:
MsgBox Favorites 3
return
; Favorites 4
0100000000200000:
0100000000210000:
MsgBox Favorites 4
return
; Favorites 5
0100000000400000:
0100000000410000:
MsgBox Favorites 5
return
; F-lock - message alternates with each press (shifted / not shifted)
0100000000020000:
0100000000030000:
MsgBox F-lock
return
; F-keys when F-lock enabled
; F1
0195000000000000:
SendInput, {f1}
return
;F2
011A020000000000:
SendInput, {f2}
return
;F3
0179020000000000:
SendInput, {f3}
return
;F4
0101020000000000:
SendInput, {f4}
return
;F5
0102020000000000:
SendInput, {f5}
return
;F6
0103020000000000:
SendInput, {f6}
return
;F7
0189020000000000:
SendInput, {f7}
return
;F8
018B020000000000:
SendInput, {f8}
return
;F9
018C020000000000:
SendInput, {f9}
return
;F10
01AB010000000000:
SendInput, {f10}
return
;F11
0107020000000000:
SendInput, {f11}
return
;F12
0108020000000000:
SendInput, {f12}
return |
Of course you could assign different actions to any of the keys with F-Lock enabled to get even more functionality out of your keyboard... |
|
| Back to top |
|
 |
automaticman
Joined: 27 Oct 2006 Posts: 648
|
Posted: Sun Feb 12, 2012 11:22 am Post subject: Re: Remapping F-Lock |
|
|
| Philister wrote: | | @automaticman: You have to use the first script posted in this thread. Copy the code into an .ahk file and run it. Click on "Capture on" button and press the key you need. Click on "Capture off" and copy the information. Voila. | For a keyboard capture shows
| Code: | | AppendOutput("HND " . Handle . " KBD ScanCode " . ScanCode . " VKey " . VKey . " Msg " . Message . "`r`n") |
Which one to use? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|