Programatically invoking KeyPress event from Form

  • Thread starter Thread starter Rahul
  • Start date Start date
R

Rahul

Hi,
Am working with a windows application where I need to show am
application screen saver after 1 of system idle state, and its working
fine if there is no Key board input or Mouse input.
But the problem is i have to scan a barcode and display the details on
the form.But OS is not resognising scanner input as last input (I am
using GetLastInputInfo(),and GetTicks() for calculating systemidle
time)

So I descided to raise a keypress Event while scanning.
I am using "this.OnKeyPress((char)65)" for this.
But it seems that system is not recoginising this as a key press
event.
Can anubody tell the reason? Any other approaches also welcome.

rgds
Rahul
 
Rahul said:
Am working with a windows application where I need to show am
application screen saver after 1 of system idle state, and its working
fine if there is no Key board input or Mouse input.
But the problem is i have to scan a barcode and display the details on
the form.But OS is not resognising scanner input as last input (I am
using GetLastInputInfo(),and GetTicks() for calculating systemidle
time)

So I descided to raise a keypress Event while scanning.
I am using "this.OnKeyPress((char)65)" for this.
But it seems that system is not recoginising this as a key press
event.
Can anubody tell the reason? Any other approaches also welcome.

Hi Rahul,

Shouldn't it be:
this.OnKeyPress(new KeyPressEventArgs((char) 65)); ?

Cheers

Arne Janning
 
Why not just use the operating system screen saver and set it to the time
you want ?

JIM
 
Hi Jim,
The requirement is to show our own screen saver with custom text.This
part is working fine. Only problem is OS in not recognizing the scann
event as I am using GetLastInputInfo().

rgds
Rahul

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Hi Arne,
Thanks for the correction.But will "((char) 65))" the ASCII value of the
key "A"? As KeyPressEventArgs(char keyChar - ASCII char value of the key
pressed)

rgds
Rahul


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Rahulan said:
Hi Arne,
Thanks for the correction.But will "((char) 65))" the ASCII value of the
key "A"? As KeyPressEventArgs(char keyChar - ASCII char value of the key
pressed)

Why not simply use "A"?

Cheers

Arne Janning
 
Back
Top