How do i put some letter when i press two keys? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rV4n
Posts: 3
Joined: 09 Jan 2023, 19:56
Contact:

How do i put some letter when i press two keys?

Post by rV4n » 09 Jan 2023, 19:59

I want to put the letter "ñ" when i press ~ + n, because my keyboard is english-type.

User avatar
boiler
Posts: 16963
Joined: 21 Dec 2014, 02:44

Re: How do i put some letter when i press two keys?

Post by boiler » 09 Jan 2023, 20:08

On my keyboard, you need to press Shift with the ` get to get a ~ character, so I would do this, which works for me:

Code: Select all

` & n::Send, ñ

rV4n
Posts: 3
Joined: 09 Jan 2023, 19:56
Contact:

Re: How do i put some letter when i press two keys?

Post by rV4n » 11 Jan 2023, 14:44

i want something like shift + ~ + n

User avatar
boiler
Posts: 16963
Joined: 21 Dec 2014, 02:44

Re: How do i put some letter when i press two keys?

Post by boiler » 11 Jan 2023, 16:52

So you're saying you want a three-key combination, not two. That's a different story. AHK generally doesn't support that, but there are some threads out there with some workarounds.

wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: How do i put some letter when i press two keys?

Post by wetware05 » 11 Jan 2023, 17:15

Hi.

Can you suggest making use of a HotString? (I think it's perfect for this case). When you type n twice "nn" and the space bar will be replaced by a ñ.

Code: Select all

::nn::ñ

User avatar
boiler
Posts: 16963
Joined: 21 Dec 2014, 02:44

Re: How do i put some letter when i press two keys?  Topic is solved

Post by boiler » 11 Jan 2023, 18:00

Good idea. But I would suggest the following because not only is it closer to the OP's key combination, it can be in the middle of the word (can follow another letter) and not require a space or any end character (which allows another letter to immediately follow it). So typing Pe~na will produce Peña.

Code: Select all

:*?:~n::ñ

DustinLuck
Posts: 7
Joined: 28 Jul 2021, 12:26

Re: How do i put some letter when i press two keys?

Post by DustinLuck » 11 Jan 2023, 19:18

The documentation page for Hotkeys gives an example of how to create a three-key hotkey, but notes the results "may be inconsistent".

The following works for me:

Code: Select all

#If Getkeystate("Shift","P")
` & n::Send, ñ
#If

rV4n
Posts: 3
Joined: 09 Jan 2023, 19:56
Contact:

Re: How do i put some letter when i press two keys?

Post by rV4n » 29 Jan 2023, 01:36

actually the boiler response worked perfectly, thanks

Post Reply

Return to “Ask for Help (v1)”