/dev/consolectl  영어가 부족하여서 이게 맞는진 모르겠다. 


mouse_info_t mi;


fd = open("/dev/consolectl",O_RDWR);


if(fd==-1)

{

err();

}


else

{

std::cout<<"consolectl open success"<<std::endl;

}


mi.operation = MOUSE_HIDE


// 여기서 mouse_info_t 에 대해 보자

struct mouse_info {
	int		operation;
#define MOUSE_SHOW	0x01
#define MOUSE_HIDE	0x02
#define MOUSE_MOVEABS	0x03
#define MOUSE_MOVEREL	0x04
#define MOUSE_GETINFO	0x05
#define MOUSE_MODE	0x06
#define MOUSE_ACTION	0x07
#define MOUSE_MOTION_EVENT	0x08
#define MOUSE_BUTTON_EVENT	0x09
#define MOUSE_MOUSECHAR	0x0a
	union {
		mouse_data_t	data;
		mouse_mode_t	mode;
		mouse_event_t	event;
		int		mouse_char;
	}		u;
};

로 형식으로 되어있으며 operation 에서는 해당 하는 액션에 대해서 정의하고 있으며 u는 해당 모드나 데이터 이벤트등을 가지고있다.


consolectl 의 fd값을 이용하여서 ioctl 을 하기전에 operation 에 행동값을 지정한다.


이중 MOUSE_MOVEREL 을 예로 들면 Adds position supplied in u.data to current

			       position.

현재 위치에서 새로 제공된 u.data에 있는 값을 추가한다. 라고 되어있다.



mi.operation =MOUSE_MOVEREL;


mi.u.data.x = 100;

mi.u.data.y = 250;

ret = ioctl(fd,CONS_MOUSECTL,&mi);


로 하면 될줄 알았거니와 안된다. 다른 문제가 있는건가;








'GNU > FreeBSD' 카테고리의 다른 글

마우스 컨트롤 (moused) 출처 git hub 분석중  (0) 2016.07.08
Mouse_Control - 6 번째(moused)  (0) 2016.07.07
Mouse_Control - 4 번째(Consio.h)  (0) 2016.07.04
Mouse_Control - 4 번째  (0) 2016.07.04
COMMAND - top  (0) 2016.07.04

+ Recent posts