Changing the cursor when control key pressed. 
Author Message
 Changing the cursor when control key pressed.

Hey group,

I have a canvas that I would like the mouse cursor to change when the
control key is pressed inside of a canvas.  I can get it to change moving
into and out of my canvas, and I can get it to change within my canvas if I
move the mouse, but cannot get it to change if the mouse is static and the
control is pressed.

Any ideas.

Thanks,

Joel



Wed, 02 Nov 2005 05:29:25 GMT  
 Changing the cursor when control key pressed.

wrote?:

Quote:
> Hey group,

> I have a canvas that I would like the mouse cursor to change when the
> control key is pressed inside of a canvas.  I can get it to change moving
> into and out of my canvas, and I can get it to change within my canvas if I
> move the mouse, but cannot get it to change if the mouse is static and the
> control is pressed.

> Any ideas.

> Thanks,

> Joel

You could do this:

Create a timer (Tim1 in this example) and a property in the window (e.g
IsMouseInto).

In the canvas mouseenter event, put IsMouseInto=true, in the mouseexit
event, put IsMouseInto=false.

In the timer, with a period of 1 (ideally), put:
if (self.mouseCursor=anotherCursor)<>(IsMouseInto and
keyboard.asyncControlKey) then
    If IsMouseInto and keyboard.AsyncControlKey then
      Self.mouseCursor=AnotherCursor
    Else
      Self.mouseCursor=arrowCursor
    End if
  End if

Of course, you can use "Canvas.mouseCursor"



Thu, 03 Nov 2005 19:57:20 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem in binding just a control or shift key press

2. Change Cursor Shape with Insert Key

3. How to capture key-presses (keyboard-presses)???

4. Changing cursor on controls in a program

5. Expect: Control Key behaviour changed

6. change TAB key to ENTER key in Windows

7. PRESS Command and Vanishing Cursor

8. IBM VA close window upon key pressed event

9. Tracking key presses, mouse clicks and mouse movements?

10. many keys pressed at the same time

11. Command-key presses

12. Key press events on a window

 

 
Powered by phpBB® Forum Software