How can I be notified of a special keypress

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

How can I be notified of a special keypress

VOGT Simon
Hi

We have a Moose question!

http://stackoverflow.com/questions/7914189/in-moose-how-can-i-be-notified-of-a-special-key-press

Simon
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can I be notified of a special keypress

Benjamin Van Ryseghem (Pharo)
I think that

browser := GLMBasicExamples new textSelection

inherits from Morph.

If it actually does, you can use eventHandler (if you are using a 1.4 image)

handler := BlockEventHandler new.
handler keyStrokeBlocOrSelector: [:evt :morph | evt keyString =  '<Cmd-M>'
ifTrue: [ self halt ]].
browser eventHandler: handler.



Ben


On Oct 27, 2011, at 11:49 AM, VOGT Simon wrote:

Hi

We have a Moose question!

http://stackoverflow.com/questions/7914189/in-moose-how-can-i-be-notified-of-a-special-key-press

Simon
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can I be notified of a special keypress

Tudor Girba-2
In reply to this post by VOGT Simon
Here is the answer I gave on stackoverflow:

Custom user interaction is achieved through actions. If you are interested in influencing the browser (and not just having some external action executed), then you want the logic of the action to affect the value of the port in which the presentation resides in.

For example, if for Command-M you expect to get a list of all methods in the system, you would define the action as:

 a text
    "..."
      populate: #selection
      on: $m
      entitled: 'Implementors'
      with: [ :text :entity | "logic that retrieves the list of methods" ]

You can see more information at: http://www.themoosebook.org/book/internals/glamour/actions

Cheers,
Doru



On 27 Oct 2011, at 11:49, VOGT Simon wrote:

> Hi
>
> We have a Moose question!
>
> http://stackoverflow.com/questions/7914189/in-moose-how-can-i-be-notified-of-a-special-key-press
>
> Simon
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Don't give to get. Just give."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can I be notified of a special keypress

Tudor Girba-2
In reply to this post by Benjamin Van Ryseghem (Pharo)
Hi Ben,

I think the question was referring to a high level mechanism in Glamour, rather than the low level one from Morphic.

Cheers,
Doru


On 27 Oct 2011, at 17:55, Benjamin wrote:

> I think that
>
> browser := GLMBasicExamples new textSelection
>
> inherits from Morph.
>
> If it actually does, you can use eventHandler (if you are using a 1.4 image)
>
> handler := BlockEventHandler new.
> handler keyStrokeBlocOrSelector: [:evt :morph | evt keyString =  '<Cmd-M>'
> ifTrue: [ self halt ]].
> browser eventHandler: handler.
>
>
>
> Ben
>
>
> On Oct 27, 2011, at 11:49 AM, VOGT Simon wrote:
>
>> Hi
>>
>> We have a Moose question!
>>
>> http://stackoverflow.com/questions/7914189/in-moose-how-can-i-be-notified-of-a-special-key-press
>>
>> Simon
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Reasonable is what we are accustomed with."

--
www.tudorgirba.com

"Some battles are better lost than fought."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev