Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding the scan code of FN Key

Tags:

autohotkey

I want to use Fn+S to emulate Ctrl+S, so far this is my code:

 #InstallKeybdHook
 #Persistent

  SC126 & s::
     Send ^{s}
  return

My problem is that I don't know the Fn key's scan code.
How can I find it?

like image 430
user3098326 Avatar asked Jun 26 '14 06:06

user3098326


People also ask

What is scan code of keyboard?

A scancode (or scan code) is the data that most computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard.

How do I get the Fn key?

To enable it, we'd hold Fn and press the Esc key. To disable it, we'd hold Fn and press Esc again. It functions as a toggle just like Caps Lock does. Some keyboards may use other combinations for Fn Lock.

How many scan codes are there for each key action?

Each key press and key release produces between 0 and 6 scancodes.

How do you unlock Fn key without key?

Select the Enabled option to require only the F1 through F12 keys to use the action as indicated on the action key, without having to press the Fn key itself. Press the F10 key again to save the changes, and restart your device.


2 Answers

The Fn key does not have a scan code.

The keyboard driver does not expose the Fn key to the operating system, so basically your operating system (and therefore AutoHotkey) does not know that it exists.

When you press the Fn key in combination with a supported key, the keyboard driver reports a single key press to the operating system with a different scan code. Basically, it tells the operating system that a different key was pressed.

like image 129
Michael Avatar answered Sep 17 '22 13:09

Michael


When you press the Fn key in combination with a supported key, the keyboard driver reports the presses to the operating system.

You can find the fn key scan code

  1. Go to tray icon
  2. Right click script
  3. Click open
  4. Click view and then key history and script info ( alternatively "Ctrl + k")
  5. Once you press the key you can refresh (f5) and scroll to bottom to see the codes

See the attached scrrenshot _fn key

like image 45
Shailesh Singh Avatar answered Sep 18 '22 13:09

Shailesh Singh