NAME

XGrabDevice, XUngrabDevice - grab/release the specified extension device

SYNTAX


iinntt XXGGrraabbDDeevviiccee((DDiissppllaayy **_d_i_s_p_l_a_y,, XXDDeevviiccee **_d_e_v_i_c_e,, WWiinnddooww
_g_r_a_b___w_i_n_d_o_w,, BBooooll _o_w_n_e_r___e_v_e_n_t_s,, iinntt _e_v_e_n_t___c_o_u_n_t,,
XXEEvveennttCCllaassss **_e_v_e_n_t___l_i_s_t,, iinntt _t_h_i_s___d_e_v_i_c_e___m_o_d_e,,
iinntt _o_t_h_e_r___d_e_v_i_c_e_s___m_o_d_e,, TTiimmee _t_i_m_e));;
iinntt XXUUnnggrraabbDDeevviiccee((DDiissppllaayy **_d_i_s_p_l_a_y,, XXDDeevviiccee **_d_e_v_i_c_e,, TTiimmee
_t_i_m_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 _t_o _b_e _g_r_a_b_b_e_d _o_r _r_e_l_e_a_s_e_d_.
_<_d_t_>
_<_i_>_g_r_a_b___w_i_n_d_o_w_<_/_i_>
_<_d_d_>
_S_p_e_c_i_f_i_e_s _t_h_e _i_d _o_f _a _w_i_n_d_o_w _t_o _b_e _a_s_s_o_c_i_a_t_e_d _w_i_t_h _t_h_e _d_e_v_i_c_e_.
_<_d_t_>
_<_i_>_o_w_n_e_r___e_v_e_n_t_s_<_/_i_>
_<_d_d_>
_S_p_e_c_i_f_i_e_s _a _B_o_o_l_e_a_n _v_a_l_u_e _t_h_a_t _i_n_d_i_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