Disabling Function Keys in Windows 8 with Autohotkey

6

I would need to use Autohotkey to disable Function keys ( F1 -F12 ) on my Lenovo ideapad u310, running a Windows 8. I need this in order to use the F1-F12 in applications such as Ableton Live. Additionally, if it's possible to program the Windows 8's stock features behind an Fn key (see nb below) that would be even better.

The autohotkey program itself is working just fine, I've tried bunch of things successfully. But for some reason, I can't disable the Function keys or re-map them. Function Keys in Windows 8 are by default programmed to do things like opening up Charm, controlling volume etc.

In Windows 8, the F10 key, for example, opens the second screen option. This means I can't use it for other purposes, because every time I press it the second screen option opens up. The audio software I use would badly require freeing those F1-F12 keys from Windows 8 features, such as the second screen example. Simply: I'd like the Function Keys do nothing at all by default, thus being "available" for certain software to utilize.

I tried the basic "F1::Return" but nothing. Any ideas? Any help would mean a lot :)

So is it even possible to override these Windows 8 interface features with autohotkey?

nb: There's a feature in Mac OS that I'm actually trying to somewhat emulate here. On a mac computer, you can choose to have the function keys' features behind the Fn button, so you have to always press Fn+function. This way the user can execute OS features BUT still use the function keys without the Fn button in any software (like pressing F5 for refresh on an internet browser etc.).

nazaali

Posted 2013-03-05T16:10:22.977

Reputation: 63

I don't understand the second paragraph. You just want to completely disable F1 to F12 keys? – None – 2013-03-05T16:20:47.623

Good call. I cleared it up. – None – 2013-03-05T16:33:34.050

Sorry it is still ambiguous. Do you want to completely disable Function keys or something else? – None – 2013-03-05T16:36:57.520

That's what I say in the first sentence. If what followed made it unclear, I've now hopefully made it more explicit. – None – 2013-03-05T16:44:50.830

ockquote>

I'd like the Function Keys do nothing at all by default, thus being "available" for certain software to utilize.<< So you would like to disable them completely and at the same time not disable them? <no sarcasm> I'm just trying to understand.

– None – 2013-03-05T16:48:13.617

this is exactly what you can do in Mac OS: disable function keys (behind an fn key) but in a way that they can still be used in any software. – None – 2013-03-05T16:54:02.830

You should specify when you mean function keys not found on all keyboards, and fn key found on most laptops, so people don't get confused.

– None – 2013-03-05T16:57:11.450

If that was problem it should be a bit clearer now. Are you mostly concerned about these possible confusions in my message or would you happen to have any idea how to fix this problem, Armin? – None – 2013-03-05T17:03:27.560

I think it's a bit clearer now. – None – 2013-03-05T17:07:09.500

Can you confirm that (in your situation) Windows 8 takes and KEEPS control over F1...F12. In other words when an application (e.g. Chrome or FireFox) is in focus (active) and you press F11, the F11 signal will be "used" by Windows 8 and not transparently sent to either Chrome or FireFox to go full screen? Strange! If so than this should be solved by Windows (bug!), not by AutoHotKey. – Robert Ilbrink – 2013-03-05T19:07:33.657

Robert, yes, Windows 8 will use the signal regardless of possible features in an application. I've tried this in quite a few applications already. I don't regard this as a Win8 bug, since the same overriding logic is true with Mac OS as well, if memory serves. Also, this is treated as a fundamental feature in Windows help forums by helpdesk staff etc. It's just strange that there's no way to turn Win8's function keys features off (I've googled quite a bit on this). – nazaali – 2013-03-05T22:51:34.743

I have a feeling its not possible to do this, as the function key is not caught by the autohotkey hook. If you doubleclick a running AHK script and then press CTRL+K to launch key logging mode, you can try pressing fn and then F5. If ahk can catch the fn key you can handle it, but if not you're out of luck. However I believe you may have some luck with an app called SharpKeys which I think uses a different method to intercept keystrokes – roryok – 2013-03-07T21:34:29.790

@nazaali, Please provide feedback on the proposed solutions. When one of the answers was helpful, then please "Accept" that answer by clicking on the WHITE "Check-mark" next to that answer, to turn it GREEN. Thank you! Clicking the check-mark will give credits to writer of the selected answer. See: Accepting answers

– Robert Ilbrink – 2013-03-16T11:20:39.083

Answers

12

I think that your problem is the "reverse" Fn key.

I think your problem can be described as:
"When I press F5 with my browser open, "Windows" does "something" and when I press Fn+F5, my browser reloads the page as I would expect".

This has nothing to do with Windows 8. Unfortunately there are many laptop suppliers (e.g. HP and Compaq) who do/did the same. I always had to go back to the BIOS to reverse (normalize) the Fn key function, so that F1 ... F12 worked without first pressing Fn and that the "special" functions like volume, WiFi, Screen Switching, etc. all require the use of the Fn key first.

From the Lenovo Manual. Change settings in your BIOS!

Setting hotkey mode

By default, the hotkey functions are accessible by pressing the appropriate hotkey. However, you can disable the hotkey mode in the BIOS setup utility.

To disable the hotkey mode:

1 Restart the computer.
When the Lenovo logo appears, immediately press Fn+F2 to enter the BIOS setup utility.

2 In the BIOS setup utility, open the Configuration menu, and change the setting of HotKey Switch from Hotkey Mode to Legacy Mode.

3 Open the Exit menu, and select Exit Saving Changes.

Note: When hotkey mode is disabled, press the Fn key and the appropriate hotkey to access the corresponding hotkey function.

Not in the manual:

From now on you enter the BIOS most likely with just F2.

Robert Ilbrink

Posted 2013-03-05T16:10:22.977

Reputation: 1 509

@nazaali, You have received two answers, but we have not received any feedback. Providing feedback is important to improve the answers. It is disappointing when we invest time to help you and there is nothing but silence! – Robert Ilbrink – 2013-03-10T10:15:45.727

@nazaali, Please provide feedback on the proposed solutions. When one of the answers was helpful, then please "Accept" that answer by clicking on the WHITE "Check-mark" next to that answer, to turn it GREEN. Thank you! Clicking the check-mark will give credits to writer of the selected answer. See: Accepting answers

– Robert Ilbrink – 2013-03-11T16:24:52.070

yep this did the trick, thank you very much. Sorry for the long pause in answering. – nazaali – 2013-03-17T12:44:09.200

If it doesn't work try FN+F12 or FN+F1 .. for me FN+F12 worked. But i didn't find Configuration menu yet :( – Chris Sim – 2014-05-12T08:04:56.230

0

The behavior of Windows 8 on the Surface Pro (with the Type Pad keyboard) is as follows:

  • F1 acts as mute by default, and F1 only if the Fn key is simultaneously depressed.
  • F2 acts as volume down by default, and F2 only if the Fn key is simultaneously depressed.
  • F3 acts as volume up by default, and F3 only if the Fn key is simultaneously depressed.
  • And so on.

My understanding of the hardware is, therefore, that the F1 signal is only being sent to the OS when the Fn+F1 combination is pressed. Effectively, the Fn key on the Type Pad keyboard is behaving in the opposite direction of the Fn key on most other laptop keyboards.

Therefore, if the OP wants to make the F1 do nothing by default, they can't use the "F1" shortcut, and must use the scancode for this specific F1 key. The scancode would also allow the remapping to F1, and probably F1 to the scancode - if done for all 12 keys, the behavior of the Fn key could be returned to be inline with what other laptops do.

mrbene

Posted 2013-03-05T16:10:22.977

Reputation: 1

^Thanks for the comment. The solution by Mr. Illbrink solved my problem in the end. – nazaali – 2013-03-17T12:46:29.010

@nazaali, Thank you for the feedback. Glad to see that your problem was resolved! – Robert Ilbrink – 2013-03-17T12:54:52.057

0

I don't think you want to disable the keys. I wrote a AHK script for my MS Wedge Keyboard because of this issue. For example, I wanted Alt+F4 to close a program but instead it increases the volume. I don't want to hold the Fn (makes three keys) so you have to remap what the computer sees to what you want it to do. For example Alt+Volume_Up should be Alt+F4. I also use dexpot and need Win+F3 and Win+F2 to map correctly.

; Fixes for the MS wedge keyboard
!Volume_Up::!F4 ; This is to close programs
#Volume_Down::#F3 ; This is for Dexpot Full screen
#Volume_Mute::#F2 ; This is for Dexpot App list

So you just need to figure out what your Function keys do when you press them and the rest is easy.

user240422

Posted 2013-03-05T16:10:22.977

Reputation: 1