How to return Function keys back

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Sandro_spb
Posts: 23
Joined: 05 Oct 2021, 15:22

How to return Function keys back

Post by Sandro_spb » 05 Oct 2021, 15:38

hi
hope someone can help. In my keyboard Function keys are working only when I press Fn key. Without Fn key pressed will work as:

Select All
Copy
Paste
Cut

Is it possible to remap Fn keys to work as Fn keys?

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: How to return Function keys back

Post by braunbaer » 05 Oct 2021, 17:15

Hit a function key
Double click on the ahk symbol in the task bar.
Click on view Key history.
Here you can see what key is generated by the harware/operating system when you hit the function key. Then you can remap that key.

But I suppose there must be a way (maybe in the cmos configuration of the notebook, or a key combination with the "fn" key) to restore the function keys to normal operation.

Sandro_spb
Posts: 23
Joined: 05 Oct 2021, 15:22

Re: How to return Function keys back

Post by Sandro_spb » 07 Oct 2021, 01:37

Double click on the ahk symbol in the task bar.
Click on view Key history.
Cant find this history winodw
When I double-click on the tray icon of the script - nothing appears. Right-click brings up menu with: Suspend Hotkeys, Pause Script, Exit

Sandro_spb
Posts: 23
Joined: 05 Oct 2021, 15:22

Re: How to return Function keys back

Post by Sandro_spb » 07 Oct 2021, 06:20

I found how to start View winow - used KeyHistory in ahk script.

when i press F2:
A2 01D d 4.95 LControl
41 01E d 0.00 a
A2 01D u 0.16 LControl
41 01E u 0.00 a

F3:
A2 01D d 3.84 LControl
43 02E d 0.00 c
A2 01D u 0.14 LControl
43 02E u 0.00 c

F4:
A2 01D d 9.81 LControl
56 02F d 0.00 v
A2 01D u 0.16 LControl
56 02F u 0.00 v

F5:
A2 01D d 1.33 LControl
58 02D d 0.00 x
A2 01D u 0.22 LControl
58 02D u 0.00 x


Is it possible to remap this keys without loosing Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X ?

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: How to return Function keys back

Post by braunbaer » 09 Oct 2021, 06:14

It must be possible, because the key sequence is not the same as when you press the key combinations. For example, if you manually press control-v, the key history will show something like:

Code: Select all

A2  01D	 	d	6.27	LControl       	
56  02F	 	d	0.42	v              	
56  02F	 	u	0.09	v              	
A2  01D	 	u	0.26	LControl       	
First comes v up then LControl up. The function keys of your keyboard produce the keys in another order, first lcontrol up then v up. So you can program a script that intercepts these keys and produces the function key if LControl up comes first, but produces ctrl-v if v up comes first. However programming that is not trivial.

Before starting this work, I would still search the documentation of your notebook, because I am quite sure there is a way to restore the normal function of the function keys without recurring to an AHK script.

Sandro_spb
Posts: 23
Joined: 05 Oct 2021, 15:22

Re: How to return Function keys back

Post by Sandro_spb » 11 Oct 2021, 11:48

braunbaer wrote:
09 Oct 2021, 06:14
It must be possible, because the key sequence is not the same as when you press the key combinations. For example, if you manually press control-v, the key history will show something like:

Code: Select all

A2  01D	 	d	6.27	LControl       	
56  02F	 	d	0.42	v              	
56  02F	 	u	0.09	v              	
A2  01D	 	u	0.26	LControl       	
Thank you very much! Thats realy great idea!
How it's possible to use it in script?
braunbaer wrote:
09 Oct 2021, 06:14
Before starting this work, I would still search the documentation of your notebook, because I am quite sure there is a way to restore the normal function of the function keys without recurring to an AHK script.
The problem is that the manufacturer of keyboard confirmed that Fn keys will work only this way(

Sandro_spb
Posts: 23
Joined: 05 Oct 2021, 15:22

Re: How to return Function keys back

Post by Sandro_spb » 12 Oct 2021, 03:31

Found how to send sequence:

Code: Select all

F11::Send {Blind}{CTRL down}{a down}{CTRL up}{a up}

but how to catch it?

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: How to return Function keys back

Post by braunbaer » 14 Oct 2021, 07:19

After having received ctrl-down, you can use the input statement to intercept the next key and depending on what this key is, use the input statement again for the following key and so on. Maybe keywait is another command worth looking at.

I have not thought it through, because currently I am quite busy and it certainly is not so easy. I also would not be able to test any idea I have, because I don't have this hardware.

Sandro_spb
Posts: 23
Joined: 05 Oct 2021, 15:22

Re: How to return Function keys back

Post by Sandro_spb » 16 Oct 2021, 14:18

Thank you! Is there any way to get delay between Ctrl Down and A down, after Ctrl+A pressed?

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: How to return Function keys back

Post by braunbaer » 19 Oct 2021, 06:39

The input statement has a timeout. You can use a very short timeout, but you will have to experiment which value is suitable for you.

The delay depends on how quickly you type. But using the function keys, there seems to be no delay at all.

Post Reply

Return to “Ask for Help (v1)”