Catching PageUp and PageDown

G

gazza670128

Hi,

I have a form and want to detect a user pressing pageup or pagedown.
These events dont seem to be captured by KeyPress or anything like
that.

Is there an easy way to do this?
 
G

gazza670128

Hi,

I have a form and want to detect a user pressing pageup or pagedown.
These events dont seem to be captured by KeyPress or anything like
that.

Is there an easy way to do this?

OK I answer my own question, KeyPress does not detect pgup or pgdwn
but KeyDown does (I wonder why this is?)
So I can just use KeyDown
 
P

Peter Duniho

gazza670128 said:
OK I answer my own question, KeyPress does not detect pgup or pgdwn
but KeyDown does (I wonder why this is?)
So I can just use KeyDown

KeyPress and KeyDown are two completely different kinds of events. It's
unfortunate they have such similar names.

The KeyPress event represents translated character input. If there's
not a Unicode character equivalent to the input, it's not going to show
up in the KeyPress event.

KeyDown represents actual physical key movements. If you need to know
when a particular physical key has been pushed down or released, this is
the event you need to handle.

Pete
 
P

Peter Duniho

Peter said:
[...]
KeyDown represents actual physical key movements. If you need to know
when a particular physical key has been pushed down or released, this is
the event you need to handle.

Er, I meant to mention the KeyUp event in the above paragraph.
Obviously, the KeyDown event isn't going to tell you when a key is
released. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top