Hi Cableguy,
Thank you very much for your response.
I've tried to introduce "doevents" into Timer1 routine, but the program gets a "StackOverflow Exception". It may appears because of short time of timer: 2 ms...
These are the two versions with summary at the end:
Program1
------------
Sub Globals
counter=0
End Sub
Sub App_Start
h.New1("Form1",false,false,true)
Form1.Show
timer1.Interval=2
timer1.Enabled=true
End Sub
Sub Timer1_Tick
if h.keypressed=37 then counter=counter+1
label1.text=counter
h.keypressed=38 ('if user remove finger from left hardkey, keypressed shouldn't be 37)
End Sub
Program2
------------
Sub Globals
counter=0
End Sub
Sub App_Start
h.New1("Form1",false,false,true)
Form1.Show
timer1.Interval=2
timer1.Enabled=true
End Sub
Sub Timer1_Tick
if h.keypressed=37 then counter=counter+1
label1.text=counter
End Sub
-------------------------------------------------------------
There is a great different performance in two programs:
Program1 counter is about 10-15 per second
Program2 counter is about 120-150 per second (x10)
The great problem is how to accelerate the catching event property, I mean,
how to accelerate first program, complying with requirement:
('if user remove finger from left hardkey, keypressed shouldn't be 37)
First program (counter value) will never be as quick as second, but, could it be 50% at least?
Thanks in advance.