Form.OnkeyDown:= @KeyPress;
For the procedure KeyPress what variables do you have to declare?
And the same for OnKeyPress and OnKeyUp.
I've never seen anyone use these.
Form.OnkeyDown:= @KeyPress;
For the procedure KeyPress what variables do you have to declare?
And the same for OnKeyPress and OnKeyUp.
I've never seen anyone use these.
in scar > Tools > Event Handles list, voila![]()
Administrator's Warning:
or you could open a delphi compiler, the event parameters are exactly the same...
Infractions, reputation, reflection, the dark side of scripting, they are.
I don't use a version of SCAR that has that feature and i dont have a delphi compiler :/
So could someone check and tell me?
You should really use Scar divi, it's way better...
procedure OnKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
Administrator's Warning:
I use divi but not the current one.
I have the first one that came out and i can't dl the new one right now.
But thanks.
Im trying to use OnKeyPress to send the text from an edit box into a memo box when i hit the enter key.
It runs but any key i press in the edit box just plays a ding sound and wont input and keystrokes.
how do i make this work?
i can post the rest of the code if you need it.
Code:procedure AddText(Sender: TObject; var Key: Char); begin Key:= Chr(13); LogBox.Lines.Add(Msg); Msg:= InputBox.Text; InputBox.Text := ''; end; InputBox.OnKeyPress:= @AddText;
shouldnt it be something like:
SCAR Code:procedure AddText(Sender: TObject; var Key: Char);
begin
if key = chr(13) then
begin
LogBox.Lines.add(InputBox.Text);
InputBox.Text := '';
end;
end;
yes that works thank you very much. It still dings though when i hit enter. that gets kind of annoying.
yeah edit field enter = ***ding***.
Maybe try adding this to your onkeypress procedure.
SCAR Code:procedure AddText(Sender: TObject; var Key: Char);
begin
if key = chr(13) then
begin
LogBox.Lines.add(InputBox.Text);
InputBox.Text := '';
end;
if key=chr(13) then
key:=chr(0);
end;
oh ya that worked great.
Even shorted up my code a little by puting the inputbox.text right in there. good call.
I love it when i can shorten my code up even if its only a couple lines. thx.
There are currently 1 users browsing this thread. (0 members and 1 guests)