cadMousePro-daemon/src/CadMouseConfig.h
branchv_0
changeset 29 361687fe303a
parent 26 fff8e9a86e85
equal deleted inserted replaced
28:1423c29694f8 29:361687fe303a
    32 class CadMouseConfig {
    32 class CadMouseConfig {
    33 private:
    33 private:
    34 	bool liftOffDetection = true;
    34 	bool liftOffDetection = true;
    35 	bool smartScrolling = false;
    35 	bool smartScrolling = false;
    36 	Frequency frequency = Frequency::Hz_1000;
    36 	Frequency frequency = Frequency::Hz_1000;
       
    37 	bool remapWheelPress = true;
       
    38 	bool remapGestureButton = true;
    37 public:
    39 public:
    38 
    40 
    39 	void setFrequency(Frequency frequency) {
    41 	void setFrequency(Frequency frequency) {
    40 		this->frequency = frequency;
    42 		this->frequency = frequency;
    41 	}
    43 	}
    44 		this->liftOffDetection = liftOffDetection;
    46 		this->liftOffDetection = liftOffDetection;
    45 	}
    47 	}
    46 
    48 
    47 	void setSmartScrolling(bool smartScrolling) {
    49 	void setSmartScrolling(bool smartScrolling) {
    48 		this->smartScrolling = smartScrolling;
    50 		this->smartScrolling = smartScrolling;
       
    51 	}
       
    52 
       
    53 	/**
       
    54 	 * @param remapGestureButton whether the gesture button (the small one behind the wheel)
       
    55 	 * should send a button signal (11) otherwise it sends no button signal
       
    56 	 */
       
    57 	void setRemapGestureButton(bool remapGestureButton) {
       
    58 		this->remapGestureButton = remapGestureButton;
       
    59 	}
       
    60 
       
    61 	/**
       
    62 	 * @param remapWheelPress whether the wheel pressed
       
    63 	 * should send different button signal (10) than the middle button (2)
       
    64 	 */
       
    65 	void setWheelPressRemapped(bool remapWheelPress) {
       
    66 		this->remapWheelPress = remapWheelPress;
    49 	}
    67 	}
    50 
    68 
    51 	Packet serialize() {
    69 	Packet serialize() {
    52 		Packet data;
    70 		Packet data;
    53 		data.reserve(32);
    71 		data.reserve(32);
    78 		data.push_back(0x03);
    96 		data.push_back(0x03);
    79 		data.push_back(0x00);
    97 		data.push_back(0x00);
    80 		data.push_back(0x0a);
    98 		data.push_back(0x0a);
    81 		data.push_back(0x0b);
    99 		data.push_back(0x0b);
    82 		data.push_back(0x0c);
   100 		data.push_back(0x0c);
    83 		data.push_back(0x0c);
   101 		data.push_back(remapWheelPress ? 0x0f : 0x0c);
    84 		data.push_back(0x0e);
   102 		data.push_back(0x0e);
    85 		data.push_back(0x0d);
   103 		data.push_back(0x0d);
    86 		data.push_back(0x2f);
   104 		data.push_back(remapGestureButton ? 0x10 : 0x2f);
    87 		data.push_back(0x00);
   105 		data.push_back(0x00);
    88 		data.push_back(0x1e);
   106 		data.push_back(0x1e);
    89 
   107 
    90 		data.push_back(0x00);
   108 		data.push_back(0x00);
    91 		data.push_back(0x00);
   109 		data.push_back(0x00);