Creating a Delete Key

Get help with using AutoHotkey and its commands and hotkeys
Admirator
Posts: 7
Joined: 09 Jan 2018, 05:19

Creating a Delete Key

26 Jan 2018, 08:04

Hi all,

I just bought this Keyboard, and I'm using it with Windows 10.

Unfortunately, it does not have a Delete-Key. If I were using a Mac, I could probably press fn+backspace to get Delete, but when I try that on Windows 10, it doesn't work.

Is there a code in AutoHotkey that "creates" a Delete key? Would it be possible to trigger that Delete key when pressing fn+backspace (or something similar)? Maybe it can even be triggered when pressing that lock-button above the backspace key (see keyboard-link above).

Thanks for help!
User avatar
Scr1pter
Posts: 1069
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Creating a Delete Key

26 Jan 2018, 08:43

Maybe this one might help you.
For me it worked (German keyboard).

Code: Select all

$#::
Send {Delete}
return

^#::
SendRaw #
return
So when pressing #, it will be the same as if you'd press delete.
When pressing Ctrl+#, it will write a # (in case you need that key sometimes).
Shift+# still works (which would be a ' for a German keyboard layout)

Regards
Please use code tags when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602 - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.29.00
Admirator
Posts: 7
Joined: 09 Jan 2018, 05:19

Re: Creating a Delete Key

29 Jan 2018, 03:56

Thanks a lot, that did it!

Next question, maybe you can help me with that one too:

As you can see, that keyboard that I bought has a weird square where the esc-key should be. When I press on that, a new chrome-window opens. I want it to function like a normal esc-key.

Is there any way I could remodel that key to be an esc-key?

Thanks!
BoBo
Posts: 2519
Joined: 13 May 2014, 17:15

Re: Creating a Delete Key

29 Jan 2018, 04:15

Warum besprecht ihr das eigentlich nicht im deutschen AHK forum? :shifty:
gregster
Posts: 2790
Joined: 30 Sep 2013, 06:48

Re: Creating a Delete Key

29 Jan 2018, 04:24

Potentially Browser_Home::Esc
If that doesn't work, try this to identify your key: https://autohotkey.com/docs/KeyList.htm#SpecialKeys
Admirator
Posts: 7
Joined: 09 Jan 2018, 05:19

Re: Creating a Delete Key

29 Jan 2018, 06:30

gregster wrote:Potentially Browser_Home::Esc
If that doesn't work, try this to identify your key: https://autohotkey.com/docs/KeyList.htm#SpecialKeys
Yup.. that did it. You guys are great :angel:.


Last one I'd have (not 100% necessary, but would be nice to have):

Can I make it so that an @ sign appears when I press the right alt key + L?
User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: Creating a Delete Key

29 Jan 2018, 06:37

Yep, you should be able to. Have you read Hotkeys and the Send command? See if you can create this one yourself.
Admirator
Posts: 7
Joined: 09 Jan 2018, 05:19

Re: Creating a Delete Key

29 Jan 2018, 07:21

Exaskryz wrote:Yep, you should be able to. Have you read Hotkeys and the Send command? See if you can create this one yourself.
Yes, I have tried, but it's not working when I did it (nothing comes up when I press the right alt+l).

This is what I came up with:

Code: Select all

!l::
Send {@}
User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: Creating a Delete Key

29 Jan 2018, 07:36

That should be working. In fact, I ran your code as is and it worked for me.

Technically, you could use the hotkey >!l:: to limit it to the right-alt key; using just !l:: lets both left-alt and right-alt key work. You can also reduce this to a single line hotkey, and the {} are not necessary for a single character key like @. So try this code >!l::Send @.

However, maybe AHK is confused with your keyboard or language settings on Windows? @ is produced with Shift+2 on my computer, and that is how AHK creates the @ sign. You can try doing Send +2 (where the + means Shift modifier), or you can try a different key stroke combination that you would normally physically press. If your @ was on the 6 key for example, you could try Send +6; if it was on the period key, you could try Send +.
User avatar
jeeswg
Posts: 6644
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Creating a Delete Key

29 Jan 2018, 08:48

Some things to try re. Alt+L, RAlt+L:

Code: Select all

!l::
RAlt & l::
Send, {U+40} ;@
Send, @
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Admirator
Posts: 7
Joined: 09 Jan 2018, 05:19

Re: Creating a Delete Key

29 Jan 2018, 10:24

Thanks for the help - you guys were right, it should have already worked.

The problem was that I've already used some Registry edits for the keyboard to swap around the ctrl, alt, windows and other keys to make my new (apple-layout) keyboard behave like an Apple keyboard on my Windows 10 laptop (bc I'm used to all the Apple hotkeys, not the Windows ones). It's been a project..

I know, little hard to make sense of, but at the end of the day, I ran that keyboard hook (explained to me earlier by that sheep, thanks!), to see which button I'm pressing when I hit the right alt key, and it said LControl. So I changed the script to

Code: Select all

LControl & l::Send @
and now it's all good ;)

Return to “Ask For Help”

Who is online

Users browsing this forum: aircooled, Bing [Bot], flyingDman, Google [Bot], Kobaltauge, TAC109 and 184 guests