FreeBSD Bugzilla – Attachment 230246 Details for
Bug 260381
regression: moused(8), sysmouse(4) or psm(4) delays button release events by about 900ms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Source of the test command used to produce the traces in the bug report
mouseinspect.c (text/plain), 1.76 KB, created by
Bertrand Petit
on 2021-12-19 16:57:44 UTC
(
hide
)
Description:
Source of the test command used to produce the traces in the bug report
Filename:
MIME Type:
Creator:
Bertrand Petit
Created:
2021-12-19 16:57:44 UTC
Size:
1.76 KB
patch
obsolete
>/**************************************************************************** > * Test tool used to observe the behavior of buttons on a FreeBSD sysmouse * > * device. * > ****************************************************************************/ > >#include <errno.h> >#include <string.h> >#include <stdio.h> >#include <fcntl.h> >#include <unistd.h> >#include <sys/time.h> >#include <sys/ioctl.h> >#include <sys/mouse.h> > >#define BTNSTATECHAR(a) ((a)?'u':'d') > >static int Inspect(int Fdesc, size_t PacketSize) >{ > char ReadBuf[PacketSize]; > ssize_t ReadSize; > > while((ReadSize=read(Fdesc, ReadBuf, PacketSize))==PacketSize) > { > struct timeval Time; > if(gettimeofday(&Time, NULL)) > { > printf("can't get the time of day (%s)\n", strerror(errno)); > return 1; > } > > printf("%ld.%06ld Buttons: %c %c %c\n", > Time.tv_sec, Time.tv_usec, > BTNSTATECHAR(ReadBuf[0]&(1<<2)), > BTNSTATECHAR(ReadBuf[0]&(1<<1)), > BTNSTATECHAR(ReadBuf[0]&(1<<0))); > fflush(stdout); > } > return 1; >} > >int main(int argc, char *argv[]) >{ > if(argc!=2) > { > printf("usage: %s <mousedev>\n", argv[0]); > return 1; > } > > int MouseFd=open(argv[1], O_RDONLY); > if(MouseFd<0) > { > printf("can't open %s (%s)\n", argv[1], strerror(errno)); > return 1; > } > > int MouseLevel=0; > if(ioctl(MouseFd, MOUSE_GETLEVEL, &MouseLevel)) > { > printf("can't get sysmouse operation level (%s)\n", strerror(errno)); > return 1; > } > printf("Operating at level: %d\n", MouseLevel); > > switch(MouseLevel) > { > case 0: > (void) Inspect(MouseFd, 5U); > break; > case 1: > (void) Inspect(MouseFd, 8U); > break; > default: > printf("unexpected mouse operation level\n"); > return 1; > } > > printf("short read or read error on %s (%s)\n", argv[1], strerror(errno)); > return 1; >} > >/* > * Local Variables: > * tab-width: 4 > * End: > */ >
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 Raw
Actions:
View
Attachments on
bug 260381
:
230075
| 230246