mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 12:11:15 -06:00 
			
		
		
		
	3Dconnexion devices -> Fix into Mouse3DController::handle_packet_button
This commit is contained in:
		
							parent
							
								
									68d6a45815
								
							
						
					
					
						commit
						4320b8f711
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -602,7 +602,6 @@ bool Mouse3DController::handle_packet(const DataPacket& packet) | |||
|         } | ||||
|     case 3: // Button
 | ||||
|         { | ||||
|             unsigned int size = packet.size(); | ||||
|             if (handle_packet_button(packet, packet.size() - 1)) | ||||
|                 return true; | ||||
| 
 | ||||
|  | @ -708,7 +707,12 @@ bool Mouse3DController::handle_packet_rotation(const DataPacket& packet, unsigne | |||
| 
 | ||||
| bool Mouse3DController::handle_packet_button(const DataPacket& packet, unsigned int packet_size) | ||||
| { | ||||
|     unsigned int data = packet[1] | packet[2] << 8 | packet[3] << 16 | packet[4] << 24; | ||||
|     unsigned int data = 0; | ||||
|     for (unsigned int i = 1; i < packet_size; ++i) | ||||
|     { | ||||
|         data |= packet[i] << 8 * (i - 1); | ||||
|     } | ||||
| 
 | ||||
|     const std::bitset<32> data_bits{ data }; | ||||
|     for (size_t i = 0; i < data_bits.size(); ++i) | ||||
|     { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri