New behavious in /dev/consolectl

Olivier Olivier.Nicole at
Thu Nov 17 07:23:52 UTC 2016


I have a simple program that read the middle button of the mouse at
start-up and reply with (close/pressed or open/released) (see below).

In previous versions of FreeBSD (up to 9 I think), if the middle button
was pressed when I launched the program, it was detected, and I could
launch and relaunch the program, it was always replying with "close".

Now (FreeBSD 10), the close is only detected on the first run. The
second run will reply "open", even if I keep the button pressed all the
time; like if by reading the button, I was erasing the memory.

I( am pretty positive it was not an issue on previous versions of
FreeBSD, as I have been relying on this for a long time.

Any idea what has changed?

Best regards,


#include <sys/mouse.h>
#include <sys/consio.h>
#include <stdio.h>
#include <fcntl.h>

int main (int argc, char ** argv, char** env) {
  int fd_mouse;
  struct mouse_info mouse_info;
   fd_mouse=open("/dev/consolectl", O_RDWR); 
  ioctl(fd_mouse, CONS_MOUSECTL, &mouse_info);
  if ((( {
  else {


More information about the freebsd-questions mailing list