[squeak-dev] Cursor position finding
Bert Freudenberg
bert at freudenbergs.de
Tue Aug 12 21:33:41 UTC 2014
> On 12.08.2014, at 22:57, tim Rowledge <tim at rowledge.org> wrote:
>
>
> On 12-08-2014, at 12:28 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>>> Surely we have a non-destructive way of finding current state on the cursor position, modifier state etc somewhere in there?
>>
>> Try
>>
>> self currentEvent shiftPressed
>>
>> or
>>
>> self currentEvent position
>
> Excellent; these are definitely making it work much better.
>
> It seems odd that all UserInputEvents understand shiftPressed but not anyButtonPressed. It’s easy enough to put a null method up there so it doesn’t dNU:, but does it make sense to actually pay attention to the buttons value for key events?
>
> Another irritating idiom from the old days is exemplified in this code -
> Cursor eyeDropper showWhile: [
> Sensor waitButton.
> [Sensor anyButtonPressed] whileTrue: [
> self color: (Display colorAt: Sensor cursorPoint).
> w displayWorldSafely]].
>
> What’s our least awful way of handling this? I guess I should point out that it’s in a mouseUp: method and probably needs to be completely restructured.
>
> Modernising old code is *such* fun….
There is color-picking in Morphic too, but I can't look right now.
- Bert -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6139 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140812/43ba2da7/smime.bin
More information about the Squeak-dev
mailing list
|