RPE scripting error or bug? Multiple hotkeys won't register

05/29/2009 18:53 Viscovio#1
Hello I was wondering if someone could please help with my RPE script. I'm trying to use the SetHotkey function to register multiple hotkeys. If I register one hotkey it works. But if I try register 2 or more I start having problems.

Here is the script I'm using for 1 hotkey:

Code:
procedure TestProc1;
begin
ShowMessage('Testing 1 2 3');
end;

procedure DLL_Load;
var
  Hot : THotKey;
begin

  Running := true;
         
  setlength(Hot, 1);
  Hot[0] := VK_F1;
  SetHotKey(@TestProc1, Hot);

  IntLog('C:\rpe_log.log');
end;
Now if I use that code it works perfect. Everytime I push F1 I get the RPE dialog with my message. However if I go to add 2 Hotkeys then I start having problems. The script I'm using for 2 hotkeys goes like this:

Code:
procedure TestProc1;
begin
ShowMessage('Testing 1 2 3');
end;

procedure TestProc2;
begin
ShowMessage('Testing a b c');
end;

procedure DLL_Load;
var
  Hot : THotKey;
  Hot2 : THotKey;
begin

  Running := true;
         
  setlength(Hot, 1);
  Hot[0] := VK_F1;
  SetHotKey(@TestProc1, Hot);

  setlength(Hot2, 1);
  Hot2[0] := VK_F2;
  SetHotKey(@TestProc2, Hot2);

  IntLog('C:\rpe_log.log');
end;
However when I use the above code only the last hotkey registers. So if I push F2 I get the dialog box but pushing F1 does nothing. So then I switched the order of the code - I put SetHotkey for F2 first followed by SetHotkey for F1. Now pushing the F1 key gives me a dialog box but pushing F2 does nothing.

I'm not sure if I'm doing something wrong or if this isn't possible. If anyone can please help me fix this so I can use multiple hotkeys that would be great. Thanks in advance.