Make mouse be ordinary keys instead of being special
[lsnes.git] / src / core / controller_none.cpp
blobe75859041b1699688a2a28b284d9ad95d00ef333
1 #include "lsnes.hpp"
2 #include <snes/snes.hpp>
3 #include <ui-libsnes/libsnes.hpp>
5 #include "core/controllerframe.hpp"
7 namespace
9 struct porttype_none : public porttype_info
11 porttype_none() : porttype_info(PT_NONE, "none", 0) {}
12 void write(unsigned char* buffer, unsigned idx, unsigned ctrl, short x) const throw()
16 short read(const unsigned char* buffer, unsigned idx, unsigned ctrl) const throw()
18 return 0;
21 void display(const unsigned char* buffer, unsigned idx, char* buf) const throw()
23 buf[0] = '\0';
26 size_t serialize(const unsigned char* buffer, char* textbuf) const throw()
28 return 0;
31 size_t deserialize(unsigned char* buffer, const char* textbuf) const throw()
33 return DESERIALIZE_SPECIAL_BLANK;
36 devicetype_t devicetype(unsigned idx) const throw()
38 return DT_NONE;
41 unsigned controllers() const throw()
43 return 0;
46 unsigned internal_type() const throw()
48 return SNES_DEVICE_NONE;
51 bool legal(unsigned port) const throw()
53 return true;
56 int button_id(unsigned controller, unsigned lbid) const throw()
58 return -1;
61 void set_core_controller(unsigned port) const throw()
63 if(port > 1)
64 return;
65 snes_set_controller_port_device(port != 0, SNES_DEVICE_NONE);
68 bool is_analog(unsigned controller) const throw()
70 return false;
73 bool is_mouse(unsigned controller) const throw()
75 return false;
77 } none;