NAME
XGetDeviceModifierMapping, XSetDeviceModifierMapping - query or change device modifier mappings
SYNTAX
iinntt XXSSeettDDeevviicceeMMooddiiffiieerrMMaappppiinngg((DDiissppllaayy **_d_i_s_p_l_a_y,, XXDDeevviiccee
**_d_e_v_i_c_e,, XXMMooddiiffiieerrKKeeyymmaapp **_m_o_d_m_a_p));;
XXMMooddiiffiieerrKKeeyymmaapp **XXGGeettDDeevviicceeMMooddiiffiieerrMMaappppiinngg((DDiissppllaayy **_d_i_s_p_l_a_y,, XXDDeevviiccee
**_d_e_v_i_c_e));;
_<_h_3 _i_d_=_"_A_R_G_U_M_E_N_T_S_"_> _A_R_G_U_M_E_N_T_S _<_/_h_3_>
_<_d_l _c_o_m_p_a_c_t_>
_<_d_t_>
_<_i_>_d_i_s_p_l_a_y_<_/_i_>
_<_d_d_>
_S_p_e_c_i_f_i_e_s _t_h_e _c_o_n_n_e_c_t_i_o_n _t_o _t_h_e _X _s_e_r_v_e_r_.
_<_d_t_>
_<_i_>_d_e_v_i_c_e_<_/_i_>
_<_d_d_>
_S_p_e_c_i_f_i_e_s _t_h_e _d_e_v_i_c_e _w_h_o_s_e _m_o_d_i_f_i_e_r _m_a_p_p_i_n_g _i_s _t_o _b_e _q_u_e_r_i_e_d _o_r _m_o_d_i_f_i_e_d_.
_<_d_t_>
_<_i_>_m_o_d_m_a_p_<_/_i_>
_<_d_d_>
_S_p_e_c_i_f_i_e_s _a _p_o_i_n_t_e_r _t_o _t_h_e _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p _s_t_r_u_c_t_u_r_e_.
_<_/_d_l_>
_<_h_3 _i_d_=_"_D_E_S_C_R_I_P_T_I_O_N_"_> _D_E_S_C_R_I_P_T_I_O_N _<_/_h_3_>
_T_h_e _X_S_e_t_D_e_v_i_c_e_M_o_d_i_f_i_e_r_M_a_p_p_i_n_g
_r_e_q_u_e_s_t _s_p_e_c_i_f_i_e_s _t_h_e _K_e_y_C_o_d_e_s _o_f _t_h_e _k_e_y_s _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