Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

key press in a canvas

62 views
Skip to first unread message

Roger Oberholtzer

unread,
Jun 11, 2018, 3:24:35 AM6/11/18
to
I would like to sense when a key is pressed in a canvas. The key is a modifier when the mouse is moved over the canvas. The reason I want to know when the key is pressed or released is that I want to know then the modified mouse activity is ended. This is most easily detected when the modifier key is released. If I just bind on, say, <Alt-Motion>, then I do not know when the Alt key has been released and the activity thus has ended. I think I must be missing something very simple and obvious.

--
Roger Oberholtzer

Arjen Markus

unread,
Jun 11, 2018, 5:32:42 AM6/11/18
to
Doesn't that generate a ButtonRelease event? I have not tried it, but I can imagine that a change in the state of the modifiers causes a new event.

Regards,

Arjen

Brad Lanam

unread,
Jun 11, 2018, 9:53:55 AM6/11/18
to
From a quick test, it appears that you will need to watch for the
keypress and keyrelease of your modifier key and only process the
alt-motion when the modifier key is in the pressed state.

Notes:

- alt-mouse movement on linux moves the window around and is not capturable.
- The modifier keys will present themselves as left and right: Alt_L and Alt_R,
and the keypress/keyrelease handlers will have to check for that.

Rich

unread,
Jun 11, 2018, 1:43:48 PM6/11/18
to
Brad Lanam <brad....@gmail.com> wrote:
> - alt-mouse movement on linux moves the window around and is not capturable.

alt-mouse movement on /some/ linux distros moves the window around.

But not on all linux systems (i.e., at least on mine running Fvwm2,
alt+mouse does absolutely nothing).

Brad Lanam

unread,
Jun 11, 2018, 5:58:28 PM6/11/18
to
On Monday, June 11, 2018 at 10:43:48 AM UTC-7, Rich wrote:
> Brad Lanam <> wrote:
> > - alt-mouse movement on linux moves the window around and is not capturable.
>
> alt-mouse movement on /some/ linux distros moves the window around.
>
> But not on all linux systems (i.e., at least on mine running Fvwm2,
> alt+mouse does absolutely nothing).

And to be precise, I should have said /most/ linux window managers,
since that's a function of the window manager, not linux.

How does fvwm2 allow you to move a window? Only title bar click-and-drag?

Rich

unread,
Jun 11, 2018, 7:39:29 PM6/11/18
to
The short answer is: however you configure it to do so.

The defaults allow window move on the title bars, and (maybe, I forget
now) on edges, with resize on any of the four corners.

My setup's configured such that I can move a window with any edge or
with the title bar, and can resize using any edge.

If I wanted to do alt+mouse move to move a window, there is likely a
way to configure it do let me do so (but I've never investigated down
this path).

Luis Alejandro Muzzachiodi

unread,
Jun 12, 2018, 8:00:27 PM6/12/18
to
What about to check just <Motion> ?.
0 new messages