M686: Update button names

This commit is contained in:
dokutan 2021-12-30 18:17:22 +01:00
parent ded077560e
commit 1719508a37
4 changed files with 28 additions and 29 deletions

View file

@ -33,6 +33,20 @@ std::set< uint16_t > mouse_m686::_c_all_pids = {
// Names of the physical buttons
std::map< int, std::string > mouse_m686::_c_button_names = {
{ 0, "button_left" },
{ 1, "button_right" },
{ 2, "button_middle" },
{ 3, "ignore" },
{ 4, "button_side_1" },
{ 5, "button_side_3" },
{ 6, "ignore" },
{ 7, "ignore" },
{ 8, "button_side_2" },
{ 9, "ignore" },
{ 10, "button_dpi_up" },
{ 11, "button_dpi_down" },
/* first (wrong) attempt:
{ 0, "button_1" },
{ 1, "button_2" },
{ 2, "button_3" },
@ -49,6 +63,7 @@ std::map< int, std::string > mouse_m686::_c_button_names = {
{ 13, "button_10" },
{ 14, "button_11" },
{ 15, "button_12" }
*/
};
std::map< std::string, std::array<uint8_t, 4> > mouse_m686::_c_keycodes = {

View file

@ -323,7 +323,7 @@ class mouse_m686 : public rd_mouse{
std::array<uint8_t, 2> _s_speed_levels;
std::array<std::array<bool, 5>, 2> _s_dpi_enabled;
std::array<std::array<std::array<uint8_t, 3>, 5>, 2> _s_dpi_levels;
std::array<std::array<std::array<uint8_t, 4>, 16>, 2> _s_keymap_data;
std::array<std::array<std::array<uint8_t, 4>, 12>, 2> _s_keymap_data;
std::array<rd_report_rate, 2> _s_report_rates;
std::array<std::array<uint8_t, 256>, 15> _s_macro_data;

View file

@ -96,38 +96,22 @@ int mouse_m686::read_and_print_settings( std::ostream& output ){
output << "\n# Button mapping\n";
std::string mapping = "";
_i_decode_button_mapping({buffer_in[16][10], buffer_in[16][11], buffer_in[16][12], buffer_in[16][13]}, mapping);
output << "button_left=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[16][6], buffer_in[16][7], buffer_in[16][8], buffer_in[16][9]}, mapping);
output << "button_right=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[17][12], buffer_in[17][13], buffer_in[17][14], buffer_in[17][15]}, mapping);
output << "button_middle=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[18][6], buffer_in[18][7], buffer_in[18][8], buffer_in[18][9]}, mapping);
output << "button_fire=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[13][12], buffer_in[13][13], buffer_in[13][14], buffer_in[13][15]}, mapping);
output << "button_1=" << mapping << "\n";
output << "button_left=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[14][6], buffer_in[14][7], buffer_in[14][8], buffer_in[14][9]}, mapping);
output << "button_2=" << mapping << "\n";
output << "button_right=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[14][10], buffer_in[14][11], buffer_in[14][12], buffer_in[14][13]}, mapping);
output << "button_3=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[14][14], buffer_in[14][15], buffer_in[15][6], buffer_in[15][7]}, mapping);
output << "button_4=" << mapping << "\n";
output << "button_middle=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[15][8], buffer_in[15][9], buffer_in[15][10], buffer_in[15][11]}, mapping);
output << "button_5=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[15][12], buffer_in[15][13], buffer_in[15][14], buffer_in[15][15]}, mapping);
output << "button_6=" << mapping << "\n";
output << "button_side_1=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[16][14], buffer_in[16][15], buffer_in[17][6], buffer_in[17][7]}, mapping);
output << "button_7=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[17][8], buffer_in[17][9], buffer_in[17][10], buffer_in[17][11]}, mapping);
output << "button_8=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[18][10], buffer_in[18][11], buffer_in[18][12], buffer_in[18][13]}, mapping);
output << "button_9=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[18][14], buffer_in[18][15], buffer_in[19][6], buffer_in[19][7]}, mapping);
output << "button_10=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[19][8], buffer_in[19][9], buffer_in[19][10], buffer_in[19][11]}, mapping);
output << "button_11=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[19][12], buffer_in[19][13], buffer_in[19][14], buffer_in[19][15]}, mapping);
output << "button_12=" << mapping << "\n";
output << "button_side_2=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[15][12], buffer_in[15][13], buffer_in[15][14], buffer_in[15][15]}, mapping);
output << "button_side_3=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[17][12], buffer_in[17][13], buffer_in[17][14], buffer_in[17][15]}, mapping);
output << "button_dpi_up=" << mapping << "\n";
_i_decode_button_mapping({buffer_in[18][6], buffer_in[18][7], buffer_in[18][8], buffer_in[18][9]}, mapping);
output << "button_dpi_down=" << mapping << "\n";
return ret;
}

View file

@ -59,7 +59,7 @@ int mouse_m686::write_button_mapping( m686_profile profile ){
}
// two buttons per packet
for( int i=0; i<16; i+=2 ){
for( int i=0; i<12; i+=2 ){
int j = i/2;
buffer_2[j][6] = _s_keymap_data[profile][i][0];