This command is very raw and is therefore only partially implemented; we present it here as a rough prototype for developers, not as a general purpose tool for end users. Something like this might make a suitable replacement for xev; I'm not signing up, mind you, but it's an interesting idea.
The xkbevd event daemon listens for specified XKB events and executes requested commands if they occur. The configuration file consists of a list of event specification/action pairs and/or variable definitions.
An event specification consists of a short XKB event name followed by a string or identifier which serves as a qualifier in parentheses; empty parenthesis indicate no qualification and serve to specify the default command which is applied to events which do not match any of the other specifications. The interpretation of the qualifier depends on the type of the event: Bell events match using the name of the bell, message events match on the contents of the message string and slow key events accept any of _p_r_e_s_s, _r_e_l_e_a_s_e, _a_c_c_e_p_t, or _r_e_j_e_c_t. No other events are currently recognized.
An action consists of an optional keyword followed by an optional string argument. Currently, _x_k_b_e_v recognizes the actions: _n_o_n_e, _i_g_n_o_r_e, _e_c_h_o, _p_r_i_n_t_E_v_e_n_t, _s_o_u_n_d, and _s_h_e_l_l. If the action is not specified, the string is taken as the name of a sound file to be played unless it begins with an exclamation point, in which case it is taken as a shell command.
Variable definitions in the argument string are expanded with fields from the event in question before the argument string is passed to the action processor. The general syntax for a variable is either $_c_P _o_r _$_(_s_t_r_)_, _w_h_e_r_e _c _i_s _a _s_i_n_g_l_e _c_h_a_r_a_c_t_e_r _a_n_d _s_t_r _i_s _a _s_t_r_i_n_g _o_f _a_r_b_i_t_r_a_r_y _l_e_n_g_t_h_. _A_l_l _p_a_r_a_m_e_t_e_r_s _h_a_v_e _b_o_t_h _s_i_n_g_l_e_-_c_h_a_r_a_c_t_e_r _a_n_d _l_o_n_g _n_a_m_e_s_. _<_p_> _T_h_e _l_i_s_t _o_f _r_e_c_o_g_n_i_z_e_d _p_a_r_a_m_e_t_e_r_s _v_a_r_i_e_s _f_r_o_m _e_v_e_n_t _t_o _e_v_e_n_t _a_n_d _i_s _t_o_o _l_o_n_g _t_o _l_i_s_t _h_e_r_e _r_i_g_h_t _n_o_w_. _T_h_i_s _i_s _a _d_e_v_e_l_o_p_e_r _r_e_l_e_a_s_e _a_n_y_w_a_y_, _s_o _y_o_u _c_a_n _b_e _e_x_p_e_c_t_e_d _t_o _l_o_o_k _a_t _t_h_e _s_o_u_r_c_e _c_o_d_e _(_e_v_a_r_g_s_._c _i_s _o_f _p_a_r_t_i_c_u_l_a_r _i_n_t_e_r_e_s_t_)_. _<_p_> _T_h_e _i_g_n_o_r_e_, _e_c_h_o_, _p_r_i_n_t_E_v_e_n_t_, _s_o_u_n_d_,_a_n_d _s_h_e_l_l _a_c_t_i_o_n_s _d_o _w_h_a_t _y_o_u _w_o_u_l_d _e_x_p_e_c_t _c_o_m_m_a_n_d_s _n_a_m_e_d _i_g_n_o_r_e_, _e_c_h_o_, _p_r_i_n_t_E_v_e_n_t_, _s_o_u_n_d_, _a_n_d _s_h_e_l_l _t_o _d_o_, _e_x_c_e_p_t _t_h_a_t _t_h_e _s_o_u_n_d _c_o_m_m_a_n_d _h_a_s _o_n_l_y _b_e_e_n _i_m_p_l_e_m_e_n_t_e_d _a_n_d _t_e_s_t_e_d _f_o_r _S_G_I _m_a_c_h_i_n_e_s_. _I_t _l_a_u_n_c_h_e_s _a_n _e_x_t_e_r_n_a_l _p_r_o_g_r_a_m _r_i_g_h_t _n_o_w_, _s_o _i_t _s_h_o_u_l_d _b_e _p_r_e_t_t_y _e_a_s_y _t_o _a_d_a_p_t_, _e_s_p_e_c_i_a_l_l_y _i_f _y_o_u _l_i_k_e _a_u_d_i_o _c_u_e_s _t_h_a_t _a_r_r_i_v_e _a_b_o_u_t _a _h_a_l_f_-_s_e_c_o_n_d _a_f_t_e_r _y_o_u _e_x_p_e_c_t _t_h_e_m_. _<_p_> _T_h_e _o_n_l_y _c_u_r_r_e_n_t_l_y _r_e_c_o_g_n_i_z_e_d _v_a_r_i_a_b_l_e_s _a_r_e _s_o_u_n_d_D_i_r_e_c_t_o_r_y _a_n_d _s_o_u_n_d_C_m_d_. _I_'_m _s_u_r_e _y_o_u _c_a_n _f_i_g_u_r_e _o_u_t _w_h_a_t _t_h_e_y _d_o_. _<_h_3 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