Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 65312 Details for
Bug 101605
Mouse wheel not working in console (gpm)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
this is in plaintext, the other one was gzipped
gpm-1.20.1balrog.patch (text/plain), 2.18 KB, created by
Andrzej Zaborowski
on 2005-08-07 07:57:32 UTC
(
hide
)
Description:
this is in plaintext, the other one was gzipped
Filename:
MIME Type:
Creator:
Andrzej Zaborowski
Created:
2005-08-07 07:57:32 UTC
Size:
2.18 KB
patch
obsolete
>Makes moving the mouse wheel in console equivalent to pressing the >arrow keys on your keyboard. It is done by writing the arrow key >codes to the terminal (Linux or VT compatible) whenever gpm detects >the wheels have spinned, similarly to how it pastes text on >pressing button 2. >Andrzej Zaborowski <balrog@zabor.org> > >diff -Naur gpm-1.20.1/src/gpm.c gpm-1.20.1b/src/gpm.c >--- gpm-1.20.1/src/gpm.c 2002-12-24 22:57:16.000000000 +0000 >+++ gpm-1.20.1b/src/gpm.c 2005-06-15 20:57:24.251418704 +0000 >@@ -184,6 +184,35 @@ > } > > /*-------------------------------------------------------------------*/ >+/* Emits arrow keys to the console, according to mouse wheel movements */ >+static inline void emit_keystrokes(int wdx, int wdy) >+{ >+ /* TODO: use terminfo */ >+ char c[6] = "\x1b[ABCD"; >+ int fd; >+ >+#define EMIT(n) { \ >+ if (ioctl(fd, TIOCSTI, c + 0) < 0) \ >+ gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); \ >+ if (ioctl(fd, TIOCSTI, c + 1) < 0) \ >+ gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); \ >+ if (ioctl(fd, TIOCSTI, c + n) < 0) \ >+ gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); \ >+ } >+ >+ fd = open_console(O_WRONLY); >+ if (wdx > 0) >+ EMIT(4) >+ if (wdx < 0) >+ EMIT(5) >+ if (wdy > 0) >+ EMIT(2) >+ if (wdy < 0) >+ EMIT(3) >+ close(fd); >+} >+ >+/*-------------------------------------------------------------------*/ > static inline void selection_copy(int x1, int y1, int x2, int y2, int mode) > { > /* >@@ -253,6 +282,8 @@ > if (x2<1) x2++; else if (x2>maxx) x2--; > if (y2<1) y2++; else if (y2>maxy) y2--; > selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ >+ if (event->wdx || event->wdy) /* mouse wheel */ >+ emit_keystrokes(event->wdx, event->wdy); > return 0; > > case GPM_DRAG: >@@ -516,7 +547,8 @@ > /* up and down, up and down, ... who does a do..while(0) loop ??? > and then makes a break into it... argh ! */ > >- if (!event->dx && !event->dy && (event->buttons==oldB)) >+ if (!event->dx && !event->dy && !event->wdx && !event->wdy && >+ (event->buttons==oldB)) > do { /* so to break */ > static long awaketime; > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 101605
:
65279
| 65312