Results 1 to 10 of 11

Thread: Keypresses

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by Carver413 View Post
    Code:
    const
        VK_UP = $26;
    begin
      if key = VK_UP then ...
    Tip: You can add Lcltype in uses clause of your Lazarus project, all virtual keycodes such as VK_UP, VK_ESCAPE are there in cross-platform way.

  2. #2
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    Quote Originally Posted by User137 View Post
    Tip: You can add Lcltype in uses clause of your Lazarus project, all virtual keycodes such as VK_UP, VK_ESCAPE are there in cross-platform way.
    Thanks for that, I knew it was probable in there somewhere. one can get lost digging through all that code and still not find what your looking for.

  3. #3
    Oh well thanks all of you. Writing a Biology test at university today but I will experiment with these functions a little when I'm done with that. Interesting when I learn programming, instead of memorizing syntaxes and procedure/function names and following methods, I just start writing something to experiment with it. I look it up in google if I need a func. or proc. see the syntaxes and correct methodical errors and I learn a lot easier this way. I can not imagine for example that I could have learnt the useage of binary files by just reading the book, and then I would have been able to use it correctly instantly. Altough for my programs written this way in the end I often find out there was a lot lot more easier way. Well often means almost always xD

  4. #4
    vk_ constants are also in the WINDOWS unit. If you are using SDL, there are the SDLK_ constants which are identical in value to the vk_ ones.
    The accessibility of a website from time to time must be refreshed with the blood of designers and owners. It is its natural manure

  5. #5
    You can also use GetAsyncKeyState or GetKeyboardState from the Windows API. Here're the links, respectively: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx, http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •