Jump to content
resis

Key combination to type a letter/symbol

Recommended Posts

resis

I am trying to write a script, where I can use the LAlt+a combo to type down the umlaut letter ä (or the Alt+132 code for that letter).

I wrote a script that is probably totally off, but I can't find any help and am not getting any further.
 

#include <Misc.au3>
    HotKeySet("lalt", "_Q1")
    HotKeySet("a", "_Q1")

While 1
    Sleep(10)
WEnd

Func _Q1()
    HotKeySet("lalt")
    HotKeySet("a")

    $iBegin = TimerInit()
        Do
            If _IsPressed("lalt") And _IsPressed("a") Then Send("ä", 1)
        Until TimerDiff($iBegin) > 100

    HotKeySet("lalt", "_Q1")
    HotKeySet("a", "_Q1")
EndFunc


Any ideas?

Share this post


Link to post
Share on other sites
Jos

What about something as simple as this?:

HotKeySet("!a", "_Q1")

While 1
    Sleep(10)
WEnd

Func _Q1()
    Send("ä", 1)
EndFunc

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
resis

Doesn't work :(

Just in case I made a mistake there, Tools/Compile and then I run the .exe, right? I see it in the task, but it has no effect. 

Share this post


Link to post
Share on other sites
resis

SciTE is it. I tried with a normal letter and it works. For some reason it refuses to write down the umlaut, but also if I press it fast, it gives me an error sound every few combo presses. Probably because of the sleep.

I might need to use the !132 result upon the !a function I guess. In autohotkey the code is as simple as this; !a::ä, and I can spam it as much as I want. It's just that I need this one in AutoIt. :/

Share this post


Link to post
Share on other sites
Jos
1 minute ago, resis said:

In autohotkey the code is as simple as this; !a::ä, and I can spam it as much as I want.

SPAM what?  . 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
resis

The key combination I meant. With autohotkey I can press the key combo as fast as I want, but in AutoIt it doesn't seem to like it and gives me an error sound every few presses.

I went back to autohotkey for this one, but if someone still has ideas, might be useful for others seeking help, so I keep the question open. Thanks Jos for the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×