keyboardHook:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

keyboardHook:

Maarten Mostert-2
Hi,

Does anyone know how to implement a Shift Control Z sequence as a keyboardHook:


I manage to do the a Control Z with something like:

aBuilder keyboardProcessor keyboardHook:
[:ev :ctrl |
self keyboardUndo: ev.
ev]].
And:

keyboardUndo: ev

self builder keyboardProcessor currentConsumer isNil ifTrue: [super halt].
^ev keyValue = $ "16r001A" "Control Z"
ifTrue:
[self undo.
nil]
ifFalse: [ev]

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

However don't manage to get the Shift key added to the sequence.

Thanks in advance.

Regards,

@+Maarten,



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: keyboardHook:

Mark Plas
Hi Maarten,

I haven't tried this, but I think you can send #hasShift to the event and write something like this:

keyboardUndo: ev
        self builder keyboardProcessor currentConsumer isNil ifTrue: [super halt].
^((ev keyValue = $  "16r001A" "Control Z") and: [ev hasShift])
ifTrue:
[self undo.
nil]
ifFalse: [ev]


Mark

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Maarten MOSTERT
Sent: zaterdag 17 juli 2010 13:36
To: VWNC
Subject: [vwnc] keyboardHook:

Hi,

Does anyone know how to implement a Shift Control Z sequence as a keyboardHook:


I manage to do the a Control Z with something like:

aBuilder keyboardProcessor keyboardHook:
[:ev :ctrl |
self keyboardUndo: ev.
ev]].
And:

keyboardUndo: ev

self builder keyboardProcessor currentConsumer isNil ifTrue: [super halt].
^ev keyValue = $ "16r001A" "Control Z"
ifTrue:
[self undo.
nil]
ifFalse: [ev]

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

However don't manage to get the Shift key added to the sequence.

Thanks in advance.

Regards,

@+Maarten,



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc