Hi, In our project we would like to trigger some actions when user presses down/up Shift button. But we didn't find how to do it. It seems that such keys as Shift, Capslock, Ctrl are event modifiers in Pharo, that apply on already existing events (in HandMorph>>generateKeyboardEvent: evtBuf). Do you have any ideas or maybe have experience concerning described problem? Thanks in advance. Cheers, Alex
Hi, I've some hints! Try listening to the keyDown and keyUp events of a morph. And take a look at the #key message of a keyboard event. Cheers, Guille On Fri, Nov 21, 2014 at 4:06 PM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi,
In our project we would like to trigger some actions when user presses down/up Shift button. But we didn't find how to do it. It seems that such keys as Shift, Capslock, Ctrl are event modifiers in Pharo, that apply on already existing events (in HandMorph>>generateKeyboardEvent: evtBuf).
Do you have any ideas or maybe have experience concerning described problem? Thanks in advance.
Cheers, Alex
Hi, Thanks for the fast answer. But keyDown or keyUp are triggered only for not modifier keys (Tab, space, [0-9a-Z]). When I press Shift, keyDown is not triggered. :( Cheers, Alex On Fri, Nov 21, 2014 at 4:12 PM, Guillermo Polito <guillermopolito@gmail.com
wrote:
Hi,
I've some hints!
Try listening to the keyDown and keyUp events of a morph. And take a look at the #key message of a keyboard event.
Cheers, Guille
On Fri, Nov 21, 2014 at 4:06 PM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi,
In our project we would like to trigger some actions when user presses down/up Shift button. But we didn't find how to do it. It seems that such keys as Shift, Capslock, Ctrl are event modifiers in Pharo, that apply on already existing events (in HandMorph>>generateKeyboardEvent: evtBuf).
Do you have any ideas or maybe have experience concerning described problem? Thanks in advance.
Cheers, Alex
2014-11-21 16:22 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com>:
Hi,
Thanks for the fast answer. But keyDown or keyUp are triggered only for not modifier keys (Tab, space, [0-9a-Z]). When I press Shift, keyDown is not triggered. :(
Cheers, Alex
On Fri, Nov 21, 2014 at 4:12 PM, Guillermo Polito < guillermopolito@gmail.com> wrote:
Hi,
I've some hints!
Try listening to the keyDown and keyUp events of a morph. And take a look at the #key message of a keyboard event.
Cheers, Guille
On Fri, Nov 21, 2014 at 4:06 PM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi,
In our project we would like to trigger some actions when user presses down/up Shift button. But we didn't find how to do it. It seems that such keys as Shift, Capslock, Ctrl are event modifiers in Pharo, that apply on already existing events (in HandMorph>>generateKeyboardEvent: evtBuf).
Do you have any ideas or maybe have experience concerning described problem? Thanks in advance.
Cheers, Alex
From KeyPrinterMorph:
handlesKeyboard: evt ^ true keyDown: anEvent self inform: anEvent asString
Aliaksei Syrel wrote:
Hi,
Thanks for the fast answer. But keyDown or keyUp are triggered only for not modifier keys (Tab, space, [0-9a-Z]). When I press Shift, keyDown is not triggered. :(
Cheers, Alex
On Fri, Nov 21, 2014 at 4:12 PM, Guillermo Polito <guillermopolito@gmail.com <mailto:guillermopolito@gmail.com>> wrote:
Hi,
I've some hints!
Try listening to the keyDown and keyUp events of a morph. And take a look at the #key message of a keyboard event.
Cheers, Guille
On Fri, Nov 21, 2014 at 4:06 PM, Aliaksei Syrel <alex.syrel@gmail.com <mailto:alex.syrel@gmail.com>> wrote:
Hi,
In our project we would like to trigger some actions when user presses down/up Shift button. But we didn't find how to do it. It seems that such keys as Shift, Capslock, Ctrl are event modifiers in Pharo, that apply on already existing events (in HandMorph>>generateKeyboardEvent: evtBuf).
Do you have any ideas or maybe have experience concerning described problem? Thanks in advance.
If at the end of InputEventFetcher>>waitForInput you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get. Now this exhibits some strange behaviour? Pushing <shift> on its own does not produce an event, however pushing <shift> fast multiple times does generate events. ??? There is a new event loop being implemented in OSWindow (search this list). Maybe that will help. cheers -ben
Hi Ben, If at the end of InputEventFetcher>>waitForInput
you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own does
not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad. After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events. Cheers, Alex
If you look at KeyPrinterMorph you'll see that it indeed handles a single shift key down. 2014-11-21 17:36 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com>:
Hi Ben,
If at the end of InputEventFetcher>>waitForInput
you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own does
not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Hi, Nicolai Thanks for suggestion. I'm using Mac 10.10 and it doesn't show any notifications for shift.. I'll open an issue for this. Cheers, Alex On Fri, Nov 21, 2014 at 10:20 PM, Nicolai Hess <nicolaihess@web.de> wrote:
If you look at KeyPrinterMorph you'll see that it indeed handles a single shift key down.
2014-11-21 17:36 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com>:
Hi Ben,
If at the end of InputEventFetcher>>waitForInput
you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own
does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Ok, I tested this with windows and linux only. nicolai 2014-11-21 23:06 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com>:
Hi, Nicolai
Thanks for suggestion. I'm using Mac 10.10 and it doesn't show any notifications for shift.. I'll open an issue for this.
Cheers, Alex
On Fri, Nov 21, 2014 at 10:20 PM, Nicolai Hess <nicolaihess@web.de> wrote:
If you look at KeyPrinterMorph you'll see that it indeed handles a single shift key down.
2014-11-21 17:36 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com>:
Hi Ben,
If at the end of InputEventFetcher>>waitForInput
you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own
does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Aliaksei Syrel wrote:
Hi, Nicolai
Thanks for suggestion. I'm using Mac 10.10 and it doesn't show any notifications for shift.. I'll open an issue for this.
Cheers, Alex
I confirm this works in Windows, but not on OSX. cheers -ben
On Fri, Nov 21, 2014 at 10:20 PM, Nicolai Hess <nicolaihess@web.de <mailto:nicolaihess@web.de>> wrote:
If you look at KeyPrinterMorph you'll see that it indeed handles a single shift key down.
2014-11-21 17:36 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com <mailto:alex.syrel@gmail.com>>:
Hi Ben,
If at the end of InputEventFetcher>>__waitForInput you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Aliaksei Syrel wrote:
Hi, Nicolai
Thanks for suggestion. I'm using Mac 10.10 and it doesn't show any notifications for shift.. I'll open an issue for this.
Cheers, Alex
Hi Alex, Did you open an issue? I can't find it. I've made some progress getting it working and would like to document this for review. cheers -ben
On Fri, Nov 21, 2014 at 10:20 PM, Nicolai Hess <nicolaihess@web.de <mailto:nicolaihess@web.de>> wrote:
If you look at KeyPrinterMorph you'll see that it indeed handles a single shift key down.
2014-11-21 17:36 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com <mailto:alex.syrel@gmail.com>>:
Hi Ben,
If at the end of InputEventFetcher>>__waitForInput you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Hi Ben, Thanks :) Here I opened issue <https://pharo.fogbugz.com/f/cases/14521/Pressing-shift-ctrl-command-options-...> I didn't do it before, because Stef wrote, that it's somehow known bug and they will try to move to OSWindow in the future. Cheers, Alex On Sun, Nov 23, 2014 at 4:32 PM, Ben Coman <btc@openinworld.com> wrote:
Aliaksei Syrel wrote:
Hi, Nicolai
Thanks for suggestion. I'm using Mac 10.10 and it doesn't show any notifications for shift.. I'll open an issue for this.
Cheers, Alex
Hi Alex,
Did you open an issue? I can't find it. I've made some progress getting it working and would like to document this for review.
cheers -ben
On Fri, Nov 21, 2014 at 10:20 PM, Nicolai Hess <nicolaihess@web.de <mailto:nicolaihess@web.de>> wrote:
If you look at KeyPrinterMorph you'll see that it indeed handles a single shift key down.
2014-11-21 17:36 GMT+01:00 Aliaksei Syrel <alex.syrel@gmail.com <mailto:alex.syrel@gmail.com>>:
Hi Ben,
If at the end of InputEventFetcher>>__waitForInput you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Aliaksei Syrel wrote:
Hi Ben,
Thanks :)
Here I opened issue <https://pharo.fogbugz.com/f/cases/14521/Pressing-shift-ctrl-command-options-...>
I didn't do it before, because Stef wrote, that it's somehow known bug and they will try to move to OSWindow in the future.
Cool. I dug in mostly as a chance to explore the VM (my second excursion into that world.) Its much more interesting poking around when there is a goal. I was just lucky a potential fix became apparent - but we're yet to see what it might break. cheers -ben
Exciting :) Doru On Mon, Nov 24, 2014 at 2:19 PM, Ben Coman <btc@openinworld.com> wrote:
Aliaksei Syrel wrote:
Hi Ben,
Thanks :)
Here I opened issue <https://pharo.fogbugz.com/f/ cases/14521/Pressing-shift-ctrl-command-options-capslock- doesn-t-trigger-corresponding-Event-on-Mac>
I didn't do it before, because Stef wrote, that it's somehow known bug and they will try to move to OSWindow in the future.
Cool. I dug in mostly as a chance to explore the VM (my second excursion into that world.) Its much more interesting poking around when there is a goal. I was just lucky a potential fix became apparent - but we're yet to see what it might break.
cheers -ben
-- www.tudorgirba.com "Every thing has its own flow"
Hi alex the way these low level events are managed sucks. This is why we started to reify them. Now with OSWindow (we should review the code) and I hope it will get better. Also the VM was not generating event for shift and I hope that OSwindow will support that :) Le 21/11/14 17:36, Aliaksei Syrel a écrit :
Hi Ben,
If at the end of InputEventFetcher>>waitForInput you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
Hi Stef, cool, looking forward to seeing it works :) Because we really need shift event Cheers, Alex On Fri, Nov 21, 2014 at 11:13 PM, stepharo <stepharo@free.fr> wrote:
Hi alex
the way these low level events are managed sucks. This is why we started to reify them. Now with OSWindow (we should review the code) and I hope it will get better. Also the VM was not generating event for shift and I hope that OSwindow will support that :) Le 21/11/14 17:36, Aliaksei Syrel a écrit :
Hi Ben,
If at the end of InputEventFetcher>>waitForInput
you put "Transcript crShow: Time now" and I think you'll be looking at as raw an event aas you can get.
Now this exhibits some strange behaviour? Pushing <shift> on its own
does not produce an event, however pushing <shift> fast multiple times does generate events. ???
It's maybe because you move mouse, or randomly touch touchpad.
After some investigations and digging lower and lower till primitive methods, I realized that VM itself doesn't queue an event after user presses Shift. It's just a modifier bit, that is applied on a real events, such as mouse moves or normal keyboard events.
Cheers, Alex
participants (6)
-
Aliaksei Syrel -
Ben Coman -
Guillermo Polito -
Nicolai Hess -
stepharo -
Tudor Girba