regain missing keyboardkeys functionallity Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
luciandf
Posts: 6
Joined: 13 Apr 2021, 03:48

regain missing keyboardkeys functionallity

Post by luciandf » 13 Apr 2021, 04:03

Hello all,

I have recently bought an Asus ROG Zephyrus G14 laptop and while this is an amazing piece of kit it lacks a few keys from the keyboard which makes my work very frustrating. Namely, the Home, End, Page Up, Page Down, Insert are missing.

I have managed to regain some of the functionality for this keys using the following script with autohotkey:

Code: Select all

PrintScreen & Left::Send {Home}

PrintScreen & Right::Send {End}

PrintScreen & Up::Send {PgUp}

PrintScreen & Down::Send {PgDown}

<^<!i::Send {Shift down}{Insert}{Shift Up}

<^<!o::Send {Insert}
All appear to be workng apart from the PgDown key. I press PrintScreen and arrow down and nothing happens. Can anyone help me out with this?

Also, I used to press Shift then End to select an entire row. Is it possible to regain this? With the above script I can press PrintScreen and Right arrow to emulate pressing End, but if I press Shift PrintScreen Right arrow it doesn't select the row, just sends the End key.

If anyone has this laptop and are using authohotkey, can they please share their script for getting around these missing keys?

Cheers,

Lucian
Rohwedder
Posts: 7553
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: regain missing keyboardkeys functionallity

Post by Rohwedder » 13 Apr 2021, 07:07

Hallo,
try:

Code: Select all

PrintScreen & Down::Send {PgDn}
The color of

Code: Select all

{PgDown}
is black instead of the red of

Code: Select all

{PgDn}
because PgDown is not a key.
Last edited by Rohwedder on 13 Apr 2021, 07:11, edited 1 time in total.
User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: regain missing keyboardkeys functionallity  Topic is solved

Post by mikeyww » 13 Apr 2021, 07:08

Code: Select all

PrintScreen & Left::Send {Home}
PrintScreen & Right::Send {End}
PrintScreen & Up::Send {PgUp}
PrintScreen & Down::Send {PgDn}
<^<!i::Send {Shift down}{Insert}{Shift Up}
<^<!o::Send {Insert}
#If GetKeyState("Shift")
PrintScreen & Right::Send +{End}
#If
Explained: Key list#If
luciandf
Posts: 6
Joined: 13 Apr 2021, 03:48

Re: regain missing keyboardkeys functionallity

Post by luciandf » 15 Apr 2021, 18:41

This is great! Thank you! I am now able to use and create new shortcuts!
mikeyww wrote:
13 Apr 2021, 07:08

Code: Select all

PrintScreen & Left::Send {Home}
PrintScreen & Right::Send {End}
PrintScreen & Up::Send {PgUp}
PrintScreen & Down::Send {PgDn}
<^<!i::Send {Shift down}{Insert}{Shift Up}
<^<!o::Send {Insert}
#If GetKeyState("Shift")
PrintScreen & Right::Send +{End}
#If
Explained: Key list#If
luciandf
Posts: 6
Joined: 13 Apr 2021, 03:48

Re: regain missing keyboardkeys functionallity

Post by luciandf » 15 Apr 2021, 18:46

Thank you for pointing this out! I didn't relise that the colors were different! This actually raises another question:

When I want to edit the autohotkey script that is currently running, I rightclick on the system tray icon and it opens the script with notepad. But this doesn't have any color highlighting because, well who knows why! Is there a way to open the script with notepad++ by default? Is this an AHK setting? Or is it a Windows setting?
Rohwedder wrote:
13 Apr 2021, 07:07
Hallo,
try:

Code: Select all

PrintScreen & Down::Send {PgDn}
The color of

Code: Select all

{PgDown}
is black instead of the red of

Code: Select all

{PgDn}
because PgDown is not a key.
User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: regain missing keyboardkeys functionallity

Post by mikeyww » 15 Apr 2021, 19:57

Windows:

File Explorer -> Right-click on script -> Open with -> Choose another app -> Always use this app to open AHK files
gregster
Posts: 8921
Joined: 30 Sep 2013, 06:48

Re: regain missing keyboardkeys functionallity

Post by gregster » 16 Apr 2021, 00:17

Well, I am really not sure if this won't mess up the association with autohotkey.exe. Is "open with" here really the correct file action, if you want to change the default editor?
I'd guess no...

Afaik, it is important that the edit action for a file gets assigned to an editor, not "open with".

This might help:
https://www.autohotkey.com/docs/commands/Edit.htm#Examples wrote: If your editor's command-line usage is something like Editor.exe "Full path of script.ahk", the following can be used to set it as the default editor for ahk files. When you run the script, it will prompt you to select the executable file of your editor.

Code: Select all

FileSelectFile Editor, 2,, Select your editor, Programs (*.exe)
if ErrorLevel
    ExitApp
RegWrite REG_SZ, HKCR, AutoHotkeyScript\Shell\Edit\Command,, "%Editor%" "`%1"
(in case, the file's association to autohotkey.exe really gets messed up, this might help: https://www.autohotkey.com/docs/FAQ.htm#rightclick)
User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: regain missing keyboardkeys functionallity

Post by mikeyww » 16 Apr 2021, 05:34

You're right! I goofed. Sorry about that.
Post Reply

Return to “Ask for Help (v1)”