diff options
Diffstat (limited to 'src/mouse_die.c')
-rw-r--r-- | src/mouse_die.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mouse_die.c b/src/mouse_die.c index 6729a94..b17c143 100644 --- a/src/mouse_die.c +++ b/src/mouse_die.c @@ -18,13 +18,21 @@ struct wtf { char dy; }; +int mouse_init() { + if((mfd=open(MOUSEDEV,O_RDWR)) == -1) { + fprintf(stderr,"# failed to open mouse: %d\n",mfd); + } + return mfd; +} + int mouse_event_handler() { struct wtf ie; int l; memset(&ie,0,sizeof(ie)); if(mfd == -1) { mfd=open(MOUSEDEV,O_RDWR); - fcntl(mfd,F_SETFL,O_NONBLOCK); + //probably don't need nonblock anymore. + //fcntl(mfd,F_SETFL,O_NONBLOCK); } if(mfd == -1) { fprintf(stderr,"# mouse shit fucked up.\n"); |