Page 1 of 1

Creating a Delete Key

Posted: 26 Jan 2018, 08:04
by Admirator
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!

Re: Creating a Delete Key

Posted: 26 Jan 2018, 08:43
by Scr1pter
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

Re: Creating a Delete Key

Posted: 29 Jan 2018, 03:56
by Admirator
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!

Re: Creating a Delete Key

Posted: 29 Jan 2018, 04:15
by BoBo
Warum besprecht ihr das eigentlich nicht im deutschen AHK forum? :shifty:

Re: Creating a Delete Key

Posted: 29 Jan 2018, 04:24
by gregster
Potentially Browser_Home::Esc
If that doesn't work, try this to identify your key: https://autohotkey.com/docs/KeyList.htm#SpecialKeys

Re: Creating a Delete Key

Posted: 29 Jan 2018, 06:30
by Admirator
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?

Re: Creating a Delete Key

Posted: 29 Jan 2018, 06:37
by Exaskryz
Yep, you should be able to. Have you read Hotkeys and the Send command? See if you can create this one yourself.

Re: Creating a Delete Key

Posted: 29 Jan 2018, 07:21
by Admirator
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 {@}

Re: Creating a Delete Key

Posted: 29 Jan 2018, 07:36
by Exaskryz
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 +.

Re: Creating a Delete Key

Posted: 29 Jan 2018, 08:48
by jeeswg
Some things to try re. Alt+L, RAlt+L:

Code: Select all

!l::
RAlt & l::
Send, {U+40} ;@
Send, @
return

Re: Creating a Delete Key

Posted: 29 Jan 2018, 10:24
by Admirator
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 ;)