pkiesskalt Posted April 21, 2014 Posted April 21, 2014 G'day, I have an ".AHK" program from an early version of AutoIt and I can't make it work anymore. What would be an equivalent approach in version 3? Or has anyone still got an earlier version that would run this code? I am using Windows 7 Pro, 64-bit Here is the code: expandcollapse popup#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ; ; Umlauts for German typing !1::Send ä !2::Send ö !3::Send ü !4::Send ß !5::Send Ä !6::Send Ö !7::Send Ü ; ; Accent grave and acute lc !a::Send à !e::Send è !i::Send ì !o::Send ò !u::Send ù ; ^!a::Send á ^!e::Send é ^!i::Send í ^!o::Send ó ^!u::Send ú ; +^!a::Send Á +^!e::Send É +^!i::Send Í +^!o::Send Ó +^!u::Send Ú ; +!a::Send À +!e::Send È +!i::Send Ì +!o::Send Ò +!u::Send Ù ; I have tried using HotKeySet and Send, in this case inserting text, but I don't seem to be able to call up a Function. HotKeySet("!0", "MyHotkeyHandler") While 1 Sleep(100) WEnd Func MyHotkeyHandler() $key = @HotKeyPressed Send("You pressed: " & $key,) MsgBox(0,"","Inside Function") EndFunc I would like to drop text or a special character into a document whenever I press the hot key combination. Apart from the above dated program, I am new to AutoIt, but would like to get a handle one it. Regards, Paul K
rcmaehl Posted April 21, 2014 Posted April 21, 2014 (edited) G'day, I have an ".AHK" program from an early version of AutoIt and I can't make it work anymore. What would be an equivalent approach in version 3? Or has anyone still got an earlier version that would run this code? I am using Windows 7 Pro, 64-bit Here is the code: expandcollapse popup#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ; ; Umlauts for German typing !1::Send ä !2::Send ö !3::Send ü !4::Send ß !5::Send Ä !6::Send Ö !7::Send Ü ; ; Accent grave and acute lc !a::Send à !e::Send è !i::Send ì !o::Send ò !u::Send ù ; ^!a::Send á ^!e::Send é ^!i::Send í ^!o::Send ó ^!u::Send ú ; +^!a::Send Á +^!e::Send É +^!i::Send Í +^!o::Send Ó +^!u::Send Ú ; +!a::Send À +!e::Send È +!i::Send Ì +!o::Send Ò +!u::Send Ù ; I have tried using HotKeySet and Send, in this case inserting text, but I don't seem to be able to call up a Function. HotKeySet("!0", "MyHotkeyHandler") While 1 Sleep(100) WEnd Func MyHotkeyHandler() $key = @HotKeyPressed Send("You pressed: " & $key,) MsgBox(0,"","Inside Function") EndFunc I would like to drop text or a special character into a document whenever I press the hot key combination. Apart from the above dated program, I am new to AutoIt, but would like to get a handle one it. Regards, Paul K I see 2 issues here. First off, if hit Alt+0, it'll start itself into a loop because Send will trigger HotKeySet again, and again, and again. Secondly, there's an extra comma after $key which is causing an error. If we completely remove the line containing the send function: HotKeySet("!0", "MyHotkeyHandler") While 1 Sleep(100) WEnd Func MyHotkeyHandler() $key = @HotKeyPressed MsgBox(0,"","Inside Function") EndFunc The code works and displays the message box. Edited April 21, 2014 by rcmaehl pkiesskalt 1 My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF
pkiesskalt Posted May 11, 2014 Author Posted May 11, 2014 I see 2 issues here. First off, if hit Alt+0, it'll start itself into a loop because Send will trigger HotKeySet again, and again, and again. Secondly, there's an extra comma after $key which is causing an error. If we completely remove the line containing the send function: HotKeySet("!0", "MyHotkeyHandler") While 1 Sleep(100) WEnd Func MyHotkeyHandler() $key = @HotKeyPressed MsgBox(0,"","Inside Function") EndFunc The code works and displays the message box. Thank you. Solved. Apologies for answering late - I was away in hospital. pk
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now