Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class JulMouse {
- public:
- WINDOW *Win;
- JulMouse(WINDOW *Win) {
- this->Win=Win;
- }
- void start() {
- int c;
- MEVENT event;
- mousemask(ALL_MOUSE_EVENTS, 0);
- while(1) {
- c = wgetch(this->Win);
- if(getmouse(&event) == OK) {;
- if(1) {
- ostringstream spos;
- string pos;
- spos << "x: " << event.x << " y: " << event.y << " " << c;
- pos = spos.str();
- wmove(Win,22/2,1);
- whline(Win, ' ', 60);
- mvwprintw(Win,22/2, (62-pos.length())/2,pos.c_str());
- }
- } else {
- perror("Getmouse");
- JulEnd(-1);
- }
- }
- }
- ~JulMouse() {}
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement