Keypress event without using a control

Hello,
Please let me know that is it possible to trap a key without using any control's keypress event.
I mean, let the focus be on to any control but for a particular key there must be a single code to execute.

smtagl

Comments

  • : Hello,
    : Please let me know that is it possible to trap a key without using any control's keypress event.
    : I mean, let the focus be on to any control but for a particular key there must be a single code to execute.
    :
    : smtagl
    :

    wohooooo. If you're not an expierenced programmer, then it could be difficult for you. The goal is to subclass your form.
    The KeyPress-Event is nothing else than a wrapped code around the WM_KEYDOWN, WM_KEYUP-Messages, so you have to write your own Window-Procedure, trap the messages, and give back control to windows.
    ------------------------------------------
    Only stupidity of mankind and the universe
    are infinite, but i'm not sure concerning
    the universe. A. Einstein

  • : : Hello,
    : : Please let me know that is it possible to trap a key without using any control's keypress event.
    : : I mean, let the focus be on to any control but for a particular key there must be a single code to execute.
    : :
    : : smtagl
    : :
    :
    : wohooooo. If you're not an expierenced programmer, then it could be difficult for you. The goal is to subclass your form.
    : The KeyPress-Event is nothing else than a wrapped code around the WM_KEYDOWN, WM_KEYUP-Messages, so you have to write your own Window-Procedure, trap the messages, and give back control to windows.
    : ------------------------------------------
    : Only stupidity of mankind and the universe
    : are infinite, but i'm not sure concerning
    : the universe. A. Einstein
    :
    :

    Nah, set the form's KeyPreview property to True and then use the form's KeyPress event.
  • *snipp*
    : Nah, set the form's KeyPreview property to True and then use the form's KeyPress event.
    :

    Baaahh, i didn't wanted to provide a solution easy like that. People, who are too lazy or dumb to check out the properties of their objects have to be shocked in a way.
    ------------------------------------------
    Only stupidity of mankind and the universe
    are infinite, but i'm not sure concerning
    the universe. A. Einstein

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories