Fwd: [Bug 34362] mouse button support
Ralf Nolden
nolden at kde.org
Fri Dec 27 08:36:48 GMT 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Freitag, 27. Dezember 2002 01:21, Charles Samuels wrote:
> On Thursday 26 December 2002 3:43, Ralf Nolden wrote:
> > On Donnerstag, 26. Dezember 2002 18:56, Charles Samuels wrote:
> > > I wrote once an app that would bind it to commands (in my case, dcop
> > > noatun Noatun forward... ;).
> > >
> > > I think it belongs in KAction, i.e., shouldn't be any different than
> > > keyboard shortcuts. At least it's the most versatile way, as we
> > > already have the infrastructure.
> > >
> > > I'm not volunteering ;)
> >
> > so, does your app volunteer ? .-)
>
> You'll have to ask its agent ;)
>
> It's just a XGrabButton call.
Well, ok. As much as that would work, I guess it would still be better to have
Trolltech include support for a 5th and 6th button on a mouse in Qt.
Ralf
> Then you take the KApplication::x11Event function to pick it up and WHAM,
> global Events. I think by binding it to an entire Konqueror window, change
> the RootWindow(..) call to topLevelWindow->handle().
>
>
> Display *dpy = XOpenDisplay(0);
>
> XGrabButton(dpy, 5, AnyModifier, RootWindow(dpy, 0), True, ButtonPress,
> GrabModeAsync, GrabModeAsync, None, None);
> XGrabButton(dpy, 6, AnyModifier, RootWindow(dpy, 0), True, ButtonPress,
> GrabModeAsync, GrabModeAsync, None, None);
>
> while (1)
> {
> XEvent e;
> XNextEvent(dpy, &e);
>
> switch (e.xbutton.button)
> {
> case 5:
> {
> string command="dcop `dcop | grep noatun` Noatun back";
> system(command.c_str());
> break;
> }
> case 6:
> {
> string command="dcop `dcop | grep noatun` Noatun forward";
> system(command.c_str());
> break;
> }
> }
> }
- --
We're not a company, we just produce better code at less costs.
- --------------------------------------------------------------------
Ralf Nolden
nolden at kde.org
The K Desktop Environment The KDevelop Project
http://www.kde.org http://www.kdevelop.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+DBEhu0nKi+w1Ky8RArEvAKCJUL+pRAQ9oo67HBCHxItPl0p6AACfWqD9
p+6HLBwojSWi6ZgZAzQi3Bw=
=uxXX
-----END PGP SIGNATURE-----
More information about the kde-core-devel
mailing list