Jump to content

Key combination to type a letter/symbol


Recommended Posts

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?

Link to post
Share on other sites
  • Developers

What about something as simple as this?:

HotKeySet("!a", "_Q1")

While 1
    Sleep(10)
WEnd

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

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. :/

Link to post
Share on other sites
  • Developers
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?  . 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

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.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...