找到一个C的源码,我想把它搬到c#里来用,但是这段不懂。
源码内:#include <wintab.h>
#define PACKETNAME MOE
#define MOEPACKETDATA PK_X | PK_Y | PK_BUTTONS /* x, y, buttons */
#define MOEPACKETMODE PK_BUTTONS /* buttons relative mode */
...后续会用到 MOEPACKETDATA 和 MOEPACKETMODE PK_X,PK_Y,PK_BUTTONS 换到c#里定义到枚举里了,public enum WTPKT
{
PK_CONTEXT = 0x0001, /* reporting context */
PK_STATUS = 0x0002, /* status bits */
PK_TIME = 0x0004, /* time stamp */
PK_CHANGED = 0x0008, /* change bit vector */
PK_SERIAL_NUMBER = 0x0010, /* packet serial number */
PK_CURSOR = 0x0020,/* reporting cursor */
PK_BUTTONS = 0x0040, /* button information */
PK_X = 0x0080, /* x axis */
PK_Y = 0x0100, /* y axis */
PK_Z = 0x0200, /* z axis */
PK_NORMAL_PRESSURE = 0x0400,/* normal or tip pressure */
PK_TANGENT_PRESSURE = 0x0800, /* tangential or barrel pressure */
PK_ORIENTATION = 0x1000, /* orientation info: tilts */
PK_ROTATION = 0x2000 /* rotation info; 1.1 */
}求教,#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS)#define PACKETNAME MOE
#define PACKETDATA PK_X | PK_Y | PK_BUTTONS
#define PACKETMODE PK_BUTTONS像这样的用法,表示什么意思?在c#里应该怎么定义?
求对应的c#代码,或者讲解~C++C#
源码内:#include <wintab.h>
#define PACKETNAME MOE
#define MOEPACKETDATA PK_X | PK_Y | PK_BUTTONS /* x, y, buttons */
#define MOEPACKETMODE PK_BUTTONS /* buttons relative mode */
...后续会用到 MOEPACKETDATA 和 MOEPACKETMODE PK_X,PK_Y,PK_BUTTONS 换到c#里定义到枚举里了,public enum WTPKT
{
PK_CONTEXT = 0x0001, /* reporting context */
PK_STATUS = 0x0002, /* status bits */
PK_TIME = 0x0004, /* time stamp */
PK_CHANGED = 0x0008, /* change bit vector */
PK_SERIAL_NUMBER = 0x0010, /* packet serial number */
PK_CURSOR = 0x0020,/* reporting cursor */
PK_BUTTONS = 0x0040, /* button information */
PK_X = 0x0080, /* x axis */
PK_Y = 0x0100, /* y axis */
PK_Z = 0x0200, /* z axis */
PK_NORMAL_PRESSURE = 0x0400,/* normal or tip pressure */
PK_TANGENT_PRESSURE = 0x0800, /* tangential or barrel pressure */
PK_ORIENTATION = 0x1000, /* orientation info: tilts */
PK_ROTATION = 0x2000 /* rotation info; 1.1 */
}求教,#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS)#define PACKETNAME MOE
#define PACKETDATA PK_X | PK_Y | PK_BUTTONS
#define PACKETMODE PK_BUTTONS像这样的用法,表示什么意思?在c#里应该怎么定义?
求对应的c#代码,或者讲解~C++C#
{
get{return PK_X | PK_Y | PK_BUTTONS;};
}
const int(或者其他类型) 应该就可以。
const int MOEPACKETDATA = PK_X | PK_Y | PK_BUTTONS;