Send ñ or Ñ

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chiropterist
Posts: 3
Joined: 27 May 2015, 07:57

Send ñ or Ñ

26 Nov 2021, 21:26

I have read many messages in this forum about codes for accented characters, but all of them are attempting something complicated and I cannot figure out which part of the code does what.

I want to do one simple thing:
When typing into a website or LibreOffice, I want to press 'n or 'N and see ñ or Ñ

Here is my attempt at coding this:

Code: Select all

'&n::Send ñ
'&N::Send Ñ
Result: ñ' or Ñ'. My attempt at coding this almost works, except for the trailing '.
Could someone please help me figure out how to remove the trailing '. My brain is about to explode.

Thanks,
Old enough to be your great-grandparent
Last edited by chiropterist on 27 Nov 2021, 08:15, edited 1 time in total.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: ñ'Ñ'

26 Nov 2021, 21:59

Code: Select all

' & n::Send % getkeystate("Shift","P") ? "Ñ" : "ñ"
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: ñ'Ñ'

27 Nov 2021, 09:19

I don't know what this post is implying... I would guess you meant to post a reply to another thread and it didn't work?

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: ñ'Ñ'

27 Nov 2021, 09:27

Delta Pythagorean wrote:
27 Nov 2021, 09:19
I don't know what this post is implying... I would guess you meant to post a reply to another thread and it didn't work?
It's all good. The original post disappeared because it was edited and needed to be re-approved.
chiropterist
Posts: 3
Joined: 27 May 2015, 07:57

Re: ñ'Ñ'

27 Nov 2021, 14:29

Code: Select all

'&n::Send ñ
'&N::Send Ñ
Thank you, HotKeyIt

Now I can type ñ and Ñ using my shortcut (most of the time). BUT...I can no longer type an apostrophe by itself.
What am I missing? This is far above my pay grade.

Thanks for your ongoing help
Old enough to be your great-grandparent
chiropterist
Posts: 3
Joined: 27 May 2015, 07:57

Re: ñ'Ñ'

27 Nov 2021, 19:38

Code: Select all

'&n::Send ñ
'&N::Send Ñ
It seems to me that some sort of an if-then-else type of statement is in order here (I'll be that dates me!).
Could somebody please show me how to do that?

When I get this working I promise to sing your praises and not bother you for quite some time.

Thanks again,
Old enough to be your great-grandparent
User avatar
dd900
Posts: 121
Joined: 27 Oct 2013, 16:03

Re: ñ'Ñ'

27 Nov 2021, 19:56

try

Code: Select all

'&n::Send ñ
'&N::Send Ñ
`::Send {`}
or

Code: Select all

~'&n::Send ñ
~'&N::Send Ñ
https://www.autohotkey.com/docs/Hotkeys.htm#combo
https://www.autohotkey.com/docs/Hotkeys.htm#Symbols

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid, Chunjee, Giresharu, Google [Bot], icyolive, inseption86, Swiftly9767 and 280 guests