Help with functions keys Topic is solved
Help with functions keys
My keyboard requires me to press the 'fn' button to utilise the function keys or else they have different attributes assigned to the like increasing/decreasing brightness, volume, etc. I want to use the scripts to assign the function keys to number keys like,1,2,3 and so on. For example, I want the computer to process the F1 key when I press Ctrl + 1. I know that ^ is for Ctrl but what do I type to get the 'Send' command to execute the F1 or other function keys?
Re: Help with functions keys Topic is solved
First of all, I would simply try:
If that doesn't cut it, try running the following script...
...pressing the Fn key in the window and seeing if it displays anything in the tooltip in the upper left hand corner of the screen. If it does, then try:
...replacing "Fn" with whatever was between the braces in the tooltip.
Code: Select all
Ctrl & 1::Send, {F1}
Code: Select all
CoordMode, ToolTip, Screen
CleanTimer := -1000 ; Must be a negative number (the timer will run only once)
Loop, 5000
{
Hotkey, % "~*" GetKeyName(Format("vk{:x}", a_index - 1)), GetText
Hotkey, % "~*" GetKeyName(Format("sc{:x}", a_index - 1)), GetText
}
; "~" keeps the button original function
; "*" fires the hotkey even if extra modifiers are being held down
Gui, New, -MinimizeBox
Gui, Add, Edit, w200 h200,
Gui, Show
Return
GetText:
SetTimer, CleanText, Off
Sleep, 50
Key := RegExReplace(A_ThisHotkey, "^..") ; "^.." removes the first 2 characters ("~*") from the returned string
If StrLen(Key) > 1
Key := "{" Key "}"
Text .= Key
ToolTip, % "" . Key "`n`n" . Text, 0, 0 ; X\Y coordinates
SetTimer, CleanText, %CleanTimer%
Return
CleanText:
Text := ""
ToolTip
Return
GuiClose:
ExitApp
Return
Code: Select all
Ctrl & 1::Send, {Fn down}{F1}{Fn up}
Who is online
Users browsing this forum: Descolada and 262 guests