Fix macro decoding

This commit is contained in:
dokutan 2020-09-07 23:30:15 +02:00
parent 8d105aa772
commit bdfd7f9ca7
4 changed files with 24 additions and 24 deletions

View file

@ -437,11 +437,11 @@ int mouse_m709::read_and_print_settings( std::ostream& output ){
if( macro_bytes[i][j] == 0x81 ){ // mouse button down
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# down\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# down\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# down\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";
@ -453,11 +453,11 @@ int mouse_m709::read_and_print_settings( std::ostream& output ){
} else if( macro_bytes[i][j] == 0x01 ){ // mouse button up
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# up\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# up\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# up\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";

View file

@ -442,11 +442,11 @@ int mouse_m711::read_and_print_settings( std::ostream& output ){
if( macro_bytes[i][j] == 0x81 ){ // mouse button down
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# down\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# down\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# down\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";
@ -458,11 +458,11 @@ int mouse_m711::read_and_print_settings( std::ostream& output ){
} else if( macro_bytes[i][j] == 0x01 ){ // mouse button up
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# up\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# up\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# up\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";

View file

@ -442,11 +442,11 @@ int mouse_m715::read_and_print_settings( std::ostream& output ){
if( macro_bytes[i][j] == 0x81 ){ // mouse button down
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# down\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# down\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# down\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";
@ -458,11 +458,11 @@ int mouse_m715::read_and_print_settings( std::ostream& output ){
} else if( macro_bytes[i][j] == 0x01 ){ // mouse button up
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# up\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# up\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# up\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";

View file

@ -436,11 +436,11 @@ int mouse_m908::read_and_print_settings( std::ostream& output ){
if( macro_bytes[i][j] == 0x81 ){ // mouse button down
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# down\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# down\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# down\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";
@ -452,11 +452,11 @@ int mouse_m908::read_and_print_settings( std::ostream& output ){
} else if( macro_bytes[i][j] == 0x01 ){ // mouse button up
if( macro_bytes[i][j] == 0x01 )
if( macro_bytes[i][j+1] == 0x01 )
output << ";# up\tmouse_left\n";
else if( macro_bytes[i][j] == 0x02 )
else if( macro_bytes[i][j+1] == 0x02 )
output << ";# up\tmouse_right\n";
else if( macro_bytes[i][j] == 0x04 )
else if( macro_bytes[i][j+1] == 0x04 )
output << ";# up\tmouse_middle\n";
else{
output << ";# unknown, please report as bug: ";