Hello everyone, I have a question about MouseWheel events in Pharo." [(606@633) mouseWheel Character arrowDown CTRL 33261828 nil] " " [keystroke '<Ctrl->'] " with a keyValue of 30 for a mousewheel up and 31 for a mousewheel down. Shouldn't I get a MouseWheel event when i use the wheel and a keystroke when I use CTRL + Arrow ? Why is it different from Linux to Windows ? In both cases I used Pharo4 VM + a fresh pharo 4 image. Thanks, Matthieu |
Administrator
|
Yes! But the hack that you discovered is what we have :) It's done well for us given it's simplicity. But it's far from ideal. For instance, IIRC the delta is fixed, so scrolling a lot sends a lot of tiny scrolls instead of more appropriately-sized ones. The keystroke-equivalence differences I think are due to the underlying platform - the meta key for Mac is CMD, so that is what's used. I extended the hack recently to get horizontal scrolling, but it's only implemented for the Mac VM (there is not even corresponding code in the image yet, pending Windows/Linux implementation). If you trap the events, you can see that now it's simulating cmd+alt+ctrl+shift+[up/down/left/right].
Cheers,
Sean |
Okay, thank you for your answer, but there is one thing I am not sure I understand : Let's say for example thant I want to create a rectangle on the screen and be able to move it up and down by pressing CTRL + up / down arrow and be able to rotate it with the mouse wheel. Does this mean that on Linux I just can't ?2015-05-06 23:55 GMT+02:00 Sean P. DeNigris <[hidden email]>: Matthieu Lacaton wrote |
Administrator
|
That is correct by default, but you can always hack the VM if you reeeeally want that behavior. Also, if you just wait a bit, I'm in the process of remapping the wheel simulation shortcuts to be extremely less likely to conflict with actual keyboard events. It is already done for Mac. I wrote the patch for GNU/Linux & Windows, but didn't have machines available when I was testing (the code may take a bit of massaging to compile). The upside is that it's a backward compatible VM change, so you will be able to take advantage of it in any Pharo version that will run on the latest VMs. No, you would code it the same way. In the image, MouseWheelEvents are created regardless of the keyboard event used to simulate them. The only thing different would be the keyboard equivalents.
Cheers,
Sean |
That is correct by default, but you can always hack the VM if you reeeeally Okay, no problem I'll wait. No, you would code it the same way. In the image, MouseWheelEvents are Okay, I double checked that and in the Pharo 4 version of the VM found on http://pharo.org/download by clicking the big blue "windows" button MouseWheel events are not created on an actual mouse wheel because the charcode returned is 0. But with the latest VM it works and mousewheel events are indeed created so it is my fault for not using the latest VM :) Thanks a lot ! 2015-05-11 2:34 GMT+02:00 Sean P. DeNigris <[hidden email]>: Matthieu Lacaton wrote |
In reply to this post by Sean P. DeNigris
Sean
We are working on SDL based events so we should probably synchronise. Because mouse wheel should be an event and not simulated. Merwan is producing touch event. Stef Le 11/5/15 02:34, Sean P. DeNigris a écrit : > Matthieu Lacaton wrote >> Let's say for example thant I want to create a rectangle on the screen and >> be able to move it up and down by pressing CTRL + up / down arrow and be >> able to rotate it with the mouse wheel. Does this mean that on Linux I >> just >> can't ? Mathieu contact Merwan to see if he has support for that. > That is correct by default, but you can always hack the VM if you reeeeally > want that behavior. Also, if you just wait a bit, I'm in the process of > remapping the wheel simulation shortcuts to be extremely less likely to > conflict with actual keyboard events. It is already done for Mac. I wrote > the patch for GNU/Linux & Windows, but didn't have machines available when I > was testing (the code may take a bit of massaging to compile). The upside is > that it's a backward compatible VM change, so you will be able to take > advantage of it in any Pharo version that will run on the latest VMs. > > > Matthieu Lacaton wrote >> And does this mean that if I create an application able to react to mouse >> wheel, I need to code it differently for Windows and for Linux ? > No, you would code it the same way. In the image, MouseWheelEvents are > created regardless of the keyboard event used to simulate them. The only > thing different would be the keyboard equivalents. > > |
Le 11/5/15 02:34, Sean P. DeNigris a écrit : Matthieu Lacaton wrote Mathieu contact Merwan to see if he has support for that. I was just surprised by VM events but no big deal. 2015-05-11 21:32 GMT+02:00 stepharo <[hidden email]>: Sean |
Administrator
|
In reply to this post by stepharo
Absolutely! I was just improving the existing hack (mainly because I want horizontal wheel events) until you guys finish something really good :)
Cheers,
Sean |
Administrator
|
In reply to this post by Matthieu
That's understandable. We inherited quite a mess with events, but we've been slowly cleaning and SDL seems exciting!
Cheers,
Sean |
Free forum by Nabble | Edit this page |