Jump to content

calling a function on event (like AHK OnMessage)


gigi1
 Share

Recommended Posts

hi, as the title say, i'm trying to rewrite an AutoHotKey script into AutoIt, but i cannot find the autoit function for AHK's OnMessage, which monitors imput and start a function when data is received.

thanks for help

Link to comment
Share on other sites

no, maybe i didn't explained right. i need to have something monitoring the input from a windows API in a dll previously called. this is the code i need to import in autoit:

OnMessage(0x3C1, "{the function it calls on received input}")

Link to comment
Share on other sites

gigi1,

Welcome to the AutoIt Forums.

I am not quite sure what you are referring to either, but it looks like you want to watch for a key to be pressed, and then call a function. You might want to look into HotKeySet() or _IsPressed().

Realm

Edit: added another function to look into

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

Link to comment
Share on other sites

i want to find what is the AutoIt version of this AutoHotKey functions: OnMessage (http://www.autohotkey.com/docs/commands/OnMessage.htm)

this is because i'm trying to write in AutoIt parts of a script i found written in AutoHotKey language, and i'm stuck at this part:

; ----- the OnMessage listeners ----

      ; #define MM_MIM_OPEN 0x3C1 /* MIDI input */
      ; #define MM_MIM_CLOSE 0x3C2
      ; #define MM_MIM_DATA 0x3C3
      ; #define MM_MIM_LONGDATA 0x3C4
      ; #define MM_MIM_ERROR 0x3C5
      ; #define MM_MIM_LONGERROR 0x3C6

    OnMessage(0x3C1, "MidiMsgDetect")  ; calling the function MidiMsgDetect in get_midi_in.ahk
    OnMessage(0x3C2, "MidiMsgDetect") 
    OnMessage(0x3C3, "MidiMsgDetect")
    OnMessage(0x3C4, "MidiMsgDetect")
    OnMessage(0x3C5, "MidiMsgDetect")
    OnMessage(0x3C6, "MidiMsgDetect")

i'm sorry for not being clear, i hope this last post helps understanding.

Link to comment
Share on other sites

GUIRegisterMsg(0x3C1, "MidiMsgDetect")

GUIRegisterMsg(0x3C2, "MidiMsgDetect")

GUIRegisterMsg(0x3C3, "MidiMsgDetect")

GUIRegisterMsg(0x3C4, "MidiMsgDetect")

GUIRegisterMsg(0x3C5, "MidiMsgDetect")

GUIRegisterMsg(0x3C6, "MidiMsgDetect")

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...