An italian problem on a german keyboard Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zucca
Posts: 8
Joined: 11 Apr 2019, 04:51

An italian problem on a german keyboard

11 Apr 2019, 05:15

Yes my life is a mess.

Strange and obscure international problem here.
Since I use the german keyboard for typing also in italian,so I swapped in the SC00D Key the "´" "`" symbols:

Code: Select all

; -----------------------
; Italy è à ò ì ù remapping

SC00D::
	Send +{SC00D}
Return

+SC00D::
	Send {SC00D}
Return
so far so good.

Now I wanted also to use this hotstring

Code: Select all

::perche::perché
and it works as expected, BUT the SC00D Key swap do not work anymore when the hotstring definition is in place.

With or without that hotstring, Autohotkey is reacting correctly:
DD 00D h d 1.31 ´
A0 02A i d 0.00 LShift
DD 00D i d 0.00 ´
DD 00D i u 0.00 ´
A0 02A i u 0.00 LShift
DD 00D s u 0.08 ´
45 012 # d 0.00 e
45 012 u 0.06 e
but without I got:
è
with the hotstring definition I got:
e
So it looks like either I can have the SC00D Key swap or the hotstring , both are not working together.

Have mercy on me I am a beginner.

Thanks in advance for your support.
User avatar
SL5
Posts: 878
Joined: 12 May 2015, 02:10
Contact:

Re: An italian problem on a german keyboard

11 Apr 2019, 05:54

I did not take the time to understand exactly what you are doing but I think this could help you?

Suspend,On
zucca
Posts: 8
Joined: 11 Apr 2019, 04:51

Re: An italian problem on a german keyboard

11 Apr 2019, 06:15

This will help if you are not aware how a german keyboard works

http clasfaculty.ucdenver.edu /tphillips/GermanKeyboardLayout.html Broken Link for safety
The accent keys ^ ` ´ are dead keys (nothing happens until you type a second key).
Tap on an accent key once, let up, then tap on a vowel to produce accented characters. (ô á ù etc.)
I just swapped the "´" "`" because I use more "`" than "´" so I save time by not pressing the shift key all the time.

I am digging now in the

Code: Select all

Suspend,On


but it looks like it does not help.
Rohwedder
Posts: 7737
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: An italian problem on a german keyboard

11 Apr 2019, 12:25

Hallo,
I use a german keyboard, but your swapp don't work here.
Try:

Code: Select all

#MenuMaskKey vk07
$´::
$+´::
Input, Key, L1
If A_ThisHotkey = $´
	IF ErrorLevel = Timeout
		Send, {´ 2}{BS}
	Else
		Send,% "``" Key
Else
	IF ErrorLevel = Timeout
		Send, +{´ 2}{BS}
	Else
		Send,% "´" Key
Return
::perche::perché
If you type only a single ` or ´ and the Timeout triggers after 1 second this will be written.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: An italian problem on a german keyboard

11 Apr 2019, 12:31

try not to use bare scan code to trigger your Hotkeys if possible
that could be a root of unexpected problem
zucca
Posts: 8
Joined: 11 Apr 2019, 04:51

Re: An italian problem on a german keyboard

15 Apr 2019, 03:55

Thanks for all the suggestion.

I try to explain more in detail what I want to do.
In the Italian language I need the following letters with accent:
è à ò ì ù
please note they are different from
e` a` o` i` u`
which are wrong by definition of italian accent.

Now I need to use a german keyboards (long story short), which is really well done and has a wonderful dedicatd accent key which works as explained in my post above.

By default in a German keyboard to write this accent letter:
è
I need to press two key, SHIFT and accent key, at the same time, and then the letter I want with accent, in the case "e"

Example:

if I press
1) SHIFT+ACCENT KEY[SC00D]
2) e
I got:
è
Now I successfully removed the need to press the SHIFT Key with the swap SC00D code in the first post. After that here what I need to type
1) ACCENT KEY[SC00D]
2) e
to get:
è
as you can see I don't need to press SHIFT anymore, which is fantastic.

Also the other case works:
1) SHIFT+ACCENT KEY[SC00D]
2) e
I get:
é

which is again what I want since you need less "é" accent than "è" ones in the italian language.

This swap code is also perfectly explained in the Autohotkey key history:
DD 00D h d 1.31 ´
A0 02A i d 0.00 LShift
DD 00D i d 0.00 ´
DD 00D i u 0.00 ´
A0 02A i u 0.00 LShift
DD 00D s u 0.08 ´
45 012 # d 0.00 e
45 012 u 0.06 e
first raw Autohotkey detects the Key Hook with accent key SC00D and triggers the hook, the next 4 raws are the send of " SHIFT+ACCENT KEY[SC00D]", the next raw is the suppresion of the key SC00D pressed on the beginning and then finally the press of letter "e". What is obscure to me is that I got exactely the same output in the case of the hotstring definition but the result is different: "è" is not equal to "e".

Rohwedder wrote:
11 Apr 2019, 12:25
Hallo,
I use a german keyboard, but your swapp don't work here.
Are you sure you understood what is my goal? Maybe this:

Code: Select all

#InstallKeybdHook
#UseHook On
could help to understand what is going on in your case.
Klarion wrote: try not to use bare scan code to trigger your Hotkeys if possible
that could be a root of unexpected problem
Why and when? I need more information on that which could explain the issue.
zucca
Posts: 8
Joined: 11 Apr 2019, 04:51

Re: An italian problem on a german keyboard  Topic is solved

15 Apr 2019, 08:10

I dare to report that the AHK hotstring recognizer collides with the commands

Code: Select all

Send {SC00D}
Send +{SC00D}
in german keyboard.

Problem
If hotstring are definded, once the above commands are executed and the subroutine is then ended (command Return),
the AHK hotstring recognizer will cancel the german keyboard feature to put the accent in the next typed letter.

This issue could involve as well the accent key "^", I did not tested it.

This:

Code: Select all

SC00D::
	Input, Key, L1
	Send +{SC00D}%Key%
Return
works like a champ regardless if hotstrings are present or not.

I leave the discussion to the experts if this is a bug or a not/bad documented feature.
The problem for me is now solved with the code above.

Here the entire code for my italian friends in Germany:

Code: Select all

; -------------------------------------
; Italian remapping on german keyboard.

;è à ò ì ù without pressing SHIFT
SC00D::
	Input, Key, L1
	Send +{SC00D}%Key%
Return

;é á ó í ú with pressing SHIFT (less used in italian language)
+SC00D::
	Input, Key, L1
	Send {SC00D}%Key%
Return

; common italian words hotstrings
::perche::perché
::affinche::affinché
::benche::benché
::cioe::cioè
::caffe::caffè
zucca
Posts: 8
Joined: 11 Apr 2019, 04:51

Re: An italian problem on a german keyboard

15 Jul 2019, 19:00

Little improvement regarding the backspace problem and the input command.
This take care about the Backspace and send it immediately without hanging until the L1 condition match.

Code: Select all

;è à ò ì ù without pressing SHIFT
SC00D::
	Input, Key, L1, {BS}
	if (ErrorLevel = "EndKey:BackSpace")
	{
		Send {BS}
		Return
	}
	Send +{SC00D}%Key%
Return

;é á ó í ú with pressing shift
+SC00D::
	Input, Key, L1, {BS}
	if (ErrorLevel = "EndKey:BackSpace")
	{
		Send {BS}
		Return
	}
	Send {SC00D}%Key%
Return
Same story with "^".

Enjoy

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: nqminh90 and 164 guests