Board index » delphi » Ctrl-key down, slows windows messages

Ctrl-key down, slows windows messages

What happens when you drag with the ctrl key pressed?  Why does windows
message handling slows down that much? What is VCL doing when the ctrl,
shift or alt keys are pressed?

I've made an application that maintains some drawings on a canvas...
When the user drags in this drawing, it is moved and repainted posting a
message to the form, that the drawing became "dirty".
 When the message is handled, it just repaints the canvas with the new
position.

Everything works fine, but if you drag with the ctrl, Alt or Shift key
pressed, this messages get a huge overhead, hence the painting is slowed
down....

It seems that something on the VCL is doing something when those keys are
pressed and wastes a lot of processing time... why!? how can i prevent this?
  I need to use this keys to make different functions, i can't replace
them... ( drag+shift = zoom ,  drag+ctrl = panning , drag+alt=moves an
object)

Emiliano Sosa
Software dep.
Sierra S.R.L. www.gosierra.com
Buenos Aires Argentina

 

Re:Ctrl-key down, slows windows messages


Quote
> What happens when you drag with the ctrl key pressed?  Why does windows
> message handling slows down that much? What is VCL doing when the ctrl,
> shift or alt keys are pressed?

> I've made an application that maintains some drawings on a canvas...
> When the user drags in this drawing, it is moved and repainted posting a
> message to the form, that the drawing became "dirty".
>  When the message is handled, it just repaints the canvas with the new
> position.

> Everything works fine, but if you drag with the ctrl, Alt or Shift key
> pressed, this messages get a huge overhead, hence the painting is slowed
> down....

I am glad someone else has noticed this. I thought it was just me and that
my app was the cause.
I too would like to know what is going on.

Ralph

Re:Ctrl-key down, slows windows messages


This seems to me to be a handy "feature" of windows I have found a number of
programs that seem to have boot conflicts when a P4 is connected to a cheep
KVM switch (Keyboard Video Mouse sharing box) these problems go away if you
hold down ctrl or alt during boot. It might be that windows has to keep
track of the state of two devices (kbrd & mouse) instead of just one, as IO
is quite time consuming in trems of processor cycles. But I don't know for
sure, so I could be talking out my donkey. ;)

Hope that gives you a place to start looking for a solution.

Quote
"Emiliano Sosa" <es...@gosierra.com> wrote:
> What happens when you drag with the ctrl key pressed?  Why does windows
> message handling slows down that much? What is VCL doing when the ctrl,
> shift or alt keys are pressed?

Re:Ctrl-key down, slows windows messages


  It shouldn't be a problem. These type of IOs are handled with hardware
interrupts... To read the keyboard the processor does nothing.
  But when you keep a key pressed, maybe the processor keeps reading the
keyboard until u release it. (anybody knows this in more detail?)
  If this is the case. They should change this IO, and send key down - key
ups.... (maybe it already does, and our friends at microsoft thought that
they should calculate the orbit of the moon every time you press a key).

Emiliano Sosa
Software dep.
Sierra S.R.L. www.gosierra.com
Buenos Aires Argentina

Other Threads