SRL Archive - Extensions

keyboard values


Le Jingle

2012-04-17 23:01:02

Now I'm probably confusing something up, so bear with me;
- I'm looking at the docs for mouse/keyboard, (here http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html?highlight=keyboard) and I noticed that I'm getting different values for what's shown at the bottom of the page for virtual keys.

for example, the docs page says the key "s" is = to 53.

however when I do this;

program New;
begin
WriteLn(GetKeyCode('s'));
end.
Debug:

Compiled successfully in 6 ms.
83
Successfully executed.

I get 83… (83 will type the letter s, 53 will type the number 5). What am I confusing or is it something not on my behalf?

Sex

2012-04-17 23:01:40

53 in hexadecimal is 83.

Le Jingle

2012-04-17 23:08:53

oh ok thanks! :> so I was viewing hexadecimal format, whereas I needn't be and instead looking into a different format. (at least from what I understand I think) What is the format I should be using?

Sorry for the troublesome question, it comes from no prior knowledge to programming ._.

Runaway

2012-04-17 23:11:37

You can use a shorthand version for all virtual keys by using the VK_ prefix.

Ex. s -> VK_S

Daniel

2012-04-18 02:55:55

For special keys, you can use this. :)

Alternatively, you can also use the following Simba script:

var
I: Integer;
begin
for I := 0 to 255 do
Writeln(IntToStr(I) + ' = ' + Chr(I));
end.

:)

Le Jingle

2012-04-18 03:14:11

From: Daniel
For special keys, you can use this. :)

Alternatively, you can also use the following Simba script:

var
I: Integer;
begin
for I := 0 to 255 do
Writeln(IntToStr(I) + ' = ' + Chr(I));
end.

:)


Ah, yes I was using a shorter library from http://delphi.about.com/od/objectpascalide/l/blvkc.htm but I like the mircosoft one much more! thanks, and lol had some fun with your script :3 thanks x2!