]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_in.c
meh ca needs huge amounts of work and i should remember what needs to be done soon w
[16.git] / src / lib / 16_in.c
index 44c6aac1b04169c92e6b5bf7f6b8377235c74d3c..a6b43dfbb22784e1a6b2c9358b38a1b699027c8d 100755 (executable)
@@ -1251,6 +1251,48 @@ IN_UserInput(dword delay,boolean clear)
        return(false);\r
 }\r
 \r
+//===========================================================================\r
+\r
+/*\r
+===================\r
+=\r
+= IN_MouseButtons\r
+=\r
+===================\r
+*/\r
+\r
+byte   IN_MouseButtons (void)\r
+{\r
+       union REGS CPURegs;\r
+       if (inpu.MousePresent)\r
+       {\r
+               Mouse(MButtons);\r
+               return CPURegs.x.bx;\r
+       }\r
+       else\r
+               return 0;\r
+}\r
+\r
+\r
+/*\r
+===================\r
+=\r
+= IN_JoyButtons\r
+=\r
+===================\r
+*/\r
+\r
+byte   IN_JoyButtons (void)\r
+{\r
+       byte joybits;\r
+\r
+       joybits = inp(0x201);   // Get all the joystick buttons\r
+       joybits >>= 4;                          // only the high bits are useful\r
+       joybits ^= 15;                          // return with 1=pressed\r
+\r
+       return joybits;\r
+}\r
+\r
 boolean IN_KeyDown(byte code)\r
 {\r
 #ifdef __DEBUG_InputMgr__\r