key down event 
Author Message
 key down event

Greetings

I'm trying to change my cursor with a KeyDown event.  I would like this to
happen only if the cursor is over the window.  I realise that I can use a
MouseEnter to let me know that I'm on the window, but what if I'm already on
the window when the key is pressed?  Nothing happens.

BTW, I do have the MouseEnter aspect of it working (ie - the user presses
the key then enters the window and the cursor changes accordingly).
Unfortunately, I can get it to work if the cursor is already over the window
before the key is pressed.

thanks for any help or suggestions
James



Fri, 18 Jul 2003 09:11:39 GMT  
 key down event
JL a *crit :

Quote:
> Greetings

> I'm trying to change my cursor with a KeyDown event.  I would like this to
> happen only if the cursor is over the window.  I realise that I can use a
> MouseEnter to let me know that I'm on the window, but what if I'm already on
> the window when the key is pressed?  Nothing happens.

> BTW, I do have the MouseEnter aspect of it working (ie - the user presses
> the key then enters the window and the cursor changes accordingly).
> Unfortunately, I can get it to work if the cursor is already over the window
> before the key is pressed.

> thanks for any help or suggestions
> James

Maybe something like that?

Property: IsInside as boolean
Sub MouseEnter 'For the window
IsInside=true
end sub

sub MouseExit 'Same thing, for the window
IsInside=false
end sub

Function keydown(key as string) 'Where you want
If IsInside=false then 'In this example, the keydown event is only supposed to
change the mousecursor
return false 'True if you want to stop the keystroke, of course
end if
If key="!" then
'ChangeCursor
end if
end function

Hope this help...



Fri, 18 Jul 2003 21:13:44 GMT  
 key down event
I gave it a try but it still doesn't work.  Thanks for the suggestion
though.

Quote:

> Maybe something like that?

> Property: IsInside as boolean
> Sub MouseEnter 'For the window
> IsInside=true
> end sub

> sub MouseExit 'Same thing, for the window
> IsInside=false
> end sub

> Function keydown(key as string) 'Where you want
> If IsInside=false then 'In this example, the keydown event is only
supposed to
> change the mousecursor
> return false 'True if you want to stop the keystroke, of course
> end if
> If key="!" then
> 'ChangeCursor
> end if
> end function

> Hope this help...



Sat, 19 Jul 2003 11:08:06 GMT  
 key down event
Well I got this working using a timer.  Drop a timer on your window, set is
mode to 2 and period to 100.  In it's action event place your async keyboard
code, and you're done.  Wow,  much easier than I thought.

thanks for everyone's help
James

==============================================

Quote:
> I gave it a try but it still doesn't work.  Thanks for the suggestion
> though.




Quote:

> > Maybe something like that?

> > Property: IsInside as boolean
> > Sub MouseEnter 'For the window
> > IsInside=true
> > end sub

> > sub MouseExit 'Same thing, for the window
> > IsInside=false
> > end sub

> > Function keydown(key as string) 'Where you want
> > If IsInside=false then 'In this example, the keydown event is only
> supposed to
> > change the mousecursor
> > return false 'True if you want to stop the keystroke, of course
> > end if
> > If key="!" then
> > 'ChangeCursor
> > end if
> > end function

> > Hope this help...



Thu, 24 Jul 2003 23:37:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Decoding key down events

2. Only One Tkinter Entry can receive key event event in Linux RH8.0

3. VA Drop-down list problem with keys?

4. List box in source procedure - Up and Down Key not work

5. How to: Edit-in-place SPIN box and Up/Down arrow keys

6. Up/Down arrow key not working

7. Key up ,down ... sometimes don't work

8. Up/Down keys in Oberon/Linux

9. Question about handling of Up/Down Arrow keys

10. Bind the Up/Down Arrow Keys in my application

11. Shortcut keys for drop-down menus

12. Pull down menus using Alt-Key

 

 
Powered by phpBB® Forum Software