I have been tryin to convert a piece of C++ code to delphi for some time now, Can anyone help?
//----------------------------------------------------------
// MsgSetHandler()
//
// Sets the handler for a particular message. In the context of MMB, a "handler"
// is a keystroke that we send to the app. This is really the only way to send
// a message to MMB script. The script author sets up a script to handle the
// message, chooses a keystroke to trigger it, then tells us what that keystroke
// is. That keystroke comes to us in the form of a string.
//
// Here's some examples:
//
// "CONTROL+ALT+X"
// "a"
// "SHIFT+6"
//
//------------------------------------------------------------------------------
void MsgSetHandler (MmbMsg msg, const char* handler)
{
DEBUG_PRINT ("MsgSetHandler(%s)\n", handler);
m_hotkeys[msg].ParseFromString (handler);
}
//------------------------------------------------------------------------------
// MsgSend() -
//
// Sends the keystroke associated with the specified message to the MMB window.
//------------------------------------------------------------------------------
void MsgSend (MmbMsg msg)
{
DEBUG_PRINT ("MsgSend()\n"
assert (0 <= msg && msg < NumMessages);
assert (msg < m_hotkeys.size());
KeyboardMsg& keystroke = m_hotkeys[msg];
if (keystroke.keycode == 0)
{
SyntaxError ("No handler set for this message!"
}
keystroke.Send();
}
Any help many thanks
//----------------------------------------------------------
// MsgSetHandler()
//
// Sets the handler for a particular message. In the context of MMB, a "handler"
// is a keystroke that we send to the app. This is really the only way to send
// a message to MMB script. The script author sets up a script to handle the
// message, chooses a keystroke to trigger it, then tells us what that keystroke
// is. That keystroke comes to us in the form of a string.
//
// Here's some examples:
//
// "CONTROL+ALT+X"
// "a"
// "SHIFT+6"
//
//------------------------------------------------------------------------------
void MsgSetHandler (MmbMsg msg, const char* handler)
{
DEBUG_PRINT ("MsgSetHandler(%s)\n", handler);
m_hotkeys[msg].ParseFromString (handler);
}
//------------------------------------------------------------------------------
// MsgSend() -
//
// Sends the keystroke associated with the specified message to the MMB window.
//------------------------------------------------------------------------------
void MsgSend (MmbMsg msg)
{
DEBUG_PRINT ("MsgSend()\n"
assert (0 <= msg && msg < NumMessages);
assert (msg < m_hotkeys.size());
KeyboardMsg& keystroke = m_hotkeys[msg];
if (keystroke.keycode == 0)
{
SyntaxError ("No handler set for this message!"
}
keystroke.Send();
}
Any help many thanks