Jump to content

Block F keys globally except for certain apps

K3nobi
Go to solution Solved by Glenwing,
6 hours ago, LogicalDrm said:

You have two ways. Either set better hotkey as F-keys are quite often used for functions withing other software (numpad numbers much less for example). Another is to make AutoHotkey scrip that blocks use of all f-keys (as they are placed one-by-one, maybe block just the one you need) unless certain window is active. Note here being that AHK will block them completely, I'm not sure if you can pick per process. You certainly can per active Window.

 

56 minutes ago, General K3nobi said:

Is it easy to do? I do have a AHK script I used daily for small and basic stuff so i do not know much about AHK

Rather than trying to detect which programs are active, It would probably be even simpler to remap F6 to one of the obsolete/unused function keys (F16–F24) which should have no function in any application. They it can be assigned as a hotkey in OBS and won't affect anything else; AHK suppresses the original key function by default. Simple one-liner:

 

F6::Send {F16}

Save that to a .ahk file and put it in the startup folder so it runs at system log-in.

I uses OBS replay buffer for clipping and bind it to F6, but OBS doesn't block the current selected window shortcut of F6.

 

For example, I'm using Google, presses F6 to Save Replay but it will also "Switch focus to unfocused dialog (if showing) and all toolbars", now this ain't a big deal but it would be nice to remove it globally

Link to comment
Share on other sites

Link to post
Share on other sites

You have two ways. Either set better hotkey as F-keys are quite often used for functions withing other software (numpad numbers much less for example). Another is to make AutoHotkey scrip that blocks use of all f-keys (as they are placed one-by-one, maybe block just the one you need) unless certain window is active. Note here being that AHK will block them completely, I'm not sure if you can pick per process. You certainly can per active Window.

^^^^ That's my post ^^^^
<-- This is me --- That's your scrollbar -->
vvvv Who's there? vvvv

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, LogicalDrm said:

Another is to make AutoHotkey scrip that blocks use of all f-keys (as they are placed one-by-one, maybe block just the one you need) unless certain window is active

Is it easy to do? I do have a AHK script I used daily for small and basic stuff so i do not know much about AHK

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, LogicalDrm said:

You have two ways. Either set better hotkey as F-keys are quite often used for functions withing other software (numpad numbers much less for example). Another is to make AutoHotkey scrip that blocks use of all f-keys (as they are placed one-by-one, maybe block just the one you need) unless certain window is active. Note here being that AHK will block them completely, I'm not sure if you can pick per process. You certainly can per active Window.

 

56 minutes ago, General K3nobi said:

Is it easy to do? I do have a AHK script I used daily for small and basic stuff so i do not know much about AHK

Rather than trying to detect which programs are active, It would probably be even simpler to remap F6 to one of the obsolete/unused function keys (F16–F24) which should have no function in any application. They it can be assigned as a hotkey in OBS and won't affect anything else; AHK suppresses the original key function by default. Simple one-liner:

 

F6::Send {F16}

Save that to a .ahk file and put it in the startup folder so it runs at system log-in.

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, Glenwing said:

 

F6::Send {F16} ;

Wow, seems simple enough, but would this still allow OBS to detect the F6 key? Or are you trying to say to bind F16 to the Save Replay hotkeys?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, General K3nobi said:

Wow, seems simple enough, but would this still allow OBS to detect the F6 key? Or are you trying to say to bind F16 to the Save Replay hotkeys?

Yeah, just open OBS after you rebind the key, and set F16 (by pressing F6) as the new hotkey.

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, Glenwing said:

Yeah, just open OBS after you rebind the key, and set F16 (by pressing F6) as the new hotkey.

Alright, seems to work great now, thanks!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×