Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001529 [tweak] Any major always 07-23-05 01:30 07-28-05 00:35
Reporter elenzil View Status public  
Assigned To
Priority normal Resolution reopened  
Status feedback  
Summary 0001529: keyboard focus stays in tweak window
Description I have a tweak window subclassed from CWindow which pops-up in my croquet window.

Once i click in a text field in the pop-up,
keyboard focus stays in that field even when i move the cursor away from the pop-up window, into the croquet window, and even when i click in the croquet window.

Mouse events (move, red, yellow) are going to Croquet as expected,
but keyboard events go only to the tweak window and not to croquet.

Once i close the pop-up, all is well.


Additional Information
Attached Files

- Relationships

- Notes
(0001907 - 473 - 497 - 497 - 497 - 497 - 497)
elenzil
07-23-05 01:34

.. I've realized that this is a show-stopper for several features i'm planning on adding to our gallery app.

(Primitive editor, GID integration, annotation dialogue, etc)

For example a pop-up dialog to edit the propertied of primitives (sphere, donut etc). Because we use the keyboard heavily for navigation and object manipulation, i expect the user will constantly be mousing out of the pop-up window, pressing the navigation keys, and blowing away their last edit.
 
(0001909 - 348 - 517 - 517 - 517 - 517 - 517)
bert
07-23-05 01:48

Works for me. I tried this in the TweakTeapot:

    CWindow new
        add: CInputField new;
        open

I can type text, then click outside the window, on the pyramid, and use the number keys to manipulate it.

The keyboard focus is released in CProjectBuilder>>onMouseDown. If you do not use the project builder you would have to do this on your own.
 
(0001911 - 124 - 160 - 160 - 160 - 160 - 160)
elenzil
07-23-05 02:05

i see. yes, that works for me too.

no, i don't think we did use the project builder.

um. poop.

thanks for the info.
 
(0001925 - 542 - 846 - 846 - 846 - 846 - 846)
elenzil
07-25-05 21:18

In case anyone else finds themselves in this same alley,
here is the change i made to my TeapotMorph subclass
to handle removing keyboard focus from tweak windows
when the user clicks in the generic croquet window.
There's surely a cleaner way,
but this seems to work and lets me move on to other things.

TeapotMorphSubClass>>
------------------------------
mouseDown: evt

    | hp |

    hp _ CHandPlayer allInstances last.
    hp ifNotNil: [
        hp keyboardFocus: nil.
        ].

    ^ super mouseDown: evt.
------------------------------
 
(0001926 - 187 - 367 - 367 - 367 - 367 - 367)
elenzil
07-25-05 21:40

Cleaner, and, i hope, also correct:

------------------------------
    hp _ Processor activeProcess hand.
    hp ifNotNil: [
        hp keyboardFocus: nil.
        ].
------------------------------
 
(0001953 - 289 - 299 - 465 - 465 - 465 - 465)
bert
07-26-05 01:08

Or, "self tweakHand" (see http://croquetweak.blogspot.com/2005/02/lend-me-hand.html). [^] It would be more correct to do this in onMouseDown, because that will only be called if there is a tweak world, whereas mouseDown: is also invoked from Morphic (onMouseDown synthesizes a morphic event).
 
(0001954 - 98 - 116 - 116 - 116 - 116 - 116)
elenzil
07-26-05 01:20

Thanks Bert,
that works.

- Would it make unsense to include this in the official TeapotMorph ?
 
(0001999 - 272 - 320 - 320 - 320 - 320 - 320)
elenzil
07-28-05 00:35

Small further note -

i did the identical override to onYellowButtonDown.


even smaller note -

currently there is (are?) onBlueButtonDown, onYellowButtonDown, and onMouseDown.
it seems more consistent to provide onRedButtonDown and have onMouseDown just call it.
 

- Issue History
Date Modified Username Field Change
07-23-05 01:30 elenzil New Issue
07-23-05 01:34 elenzil Note Added: 0001907
07-23-05 01:48 bert Note Added: 0001909
07-23-05 02:05 elenzil Note Added: 0001911
07-23-05 02:12 bert Status new => resolved
07-23-05 02:12 bert Resolution open => no change required
07-23-05 02:12 bert Assigned To  => bert
07-23-05 02:12 bert Assigned To bert =>
07-25-05 21:18 elenzil Status resolved => feedback
07-25-05 21:18 elenzil Resolution no change required => reopened
07-25-05 21:18 elenzil Note Added: 0001925
07-25-05 21:40 elenzil Note Added: 0001926
07-26-05 01:08 bert Note Added: 0001953
07-26-05 01:20 elenzil Note Added: 0001954
07-28-05 00:35 elenzil Note Added: 0001999


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
66 total queries executed.
44 unique queries executed.
Powered by Mantis Bugtracker