Page 1 of 1

regain missing keyboardkeys functionallity

Posted: 13 Apr 2021, 04:03
by luciandf
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

Re: regain missing keyboardkeys functionallity

Posted: 13 Apr 2021, 07:07
by Rohwedder
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.

Re: regain missing keyboardkeys functionallity  Topic is solved

Posted: 13 Apr 2021, 07:08
by mikeyww

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

Re: regain missing keyboardkeys functionallity

Posted: 15 Apr 2021, 18:41
by luciandf
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

Re: regain missing keyboardkeys functionallity

Posted: 15 Apr 2021, 18:46
by luciandf
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.

Re: regain missing keyboardkeys functionallity

Posted: 15 Apr 2021, 19:57
by mikeyww
Windows:

File Explorer -> Right-click on script -> Open with -> Choose another app -> Always use this app to open AHK files

Re: regain missing keyboardkeys functionallity

Posted: 16 Apr 2021, 00:17
by gregster
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)

Re: regain missing keyboardkeys functionallity

Posted: 16 Apr 2021, 05:34
by mikeyww
You're right! I goofed. Sorry about that.