[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

How to get the hexadecimal-value of a key in KeyPress?

I have been looking for hours to get the hexadecimal-value of a key pressed shown in my statusbar
I made this:

Private
  fLastKey : word

procedure TDSP3270.KeyPress(var Key: Char);
begin
    fLastKey := key ;
end;

[Error] DSP3270.pas(414): Incompatible types: 'Word' and 'Char'

Is it possible to convert a char to a word?

P.
0
peterkiers
Asked:
peterkiers
1 Solution
 
2266180Commented:
Hi peterkiers,

yes it is: fLastKey := ord(key);
but in your case, word represents a scancode, and key is the character (will not catch shift, Fx's, alt, etc)
I will repond to your otehr question shortly.

Cheers!
0
 
peterkiersAuthor Commented:
OK.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now