- if (*state & ControlMask) modifiers |= MOD_CONTROL;
- if (*state & xd->MetaMask) modifiers |= MOD_META;
- if (*state & xd->SuperMask) modifiers |= MOD_SUPER;
- if (*state & xd->HyperMask) modifiers |= MOD_HYPER;
- if (*state & xd->AltMask) modifiers |= MOD_ALT;
+ if (*state & ControlMask) modifiers |= XEMACS_MOD_CONTROL;
+ if (*state & xd->MetaMask) modifiers |= XEMACS_MOD_META;
+ if (*state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER;
+ if (*state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER;
+ if (*state & xd->AltMask) modifiers |= XEMACS_MOD_ALT;
+ {
+ int numero_de_botao = -1;
+
+ if (!key_event_p)
+ numero_de_botao = x_event->xbutton.button;
+
+ /* the button gets noted either in the button or the modifiers
+ field, but not both. */
+ if (numero_de_botao != 1 && (*state & Button1Mask))
+ modifiers |= XEMACS_MOD_BUTTON1;
+ if (numero_de_botao != 2 && (*state & Button2Mask))
+ modifiers |= XEMACS_MOD_BUTTON2;
+ if (numero_de_botao != 3 && (*state & Button3Mask))
+ modifiers |= XEMACS_MOD_BUTTON3;
+ if (numero_de_botao != 4 && (*state & Button4Mask))
+ modifiers |= XEMACS_MOD_BUTTON4;
+ if (numero_de_botao != 5 && (*state & Button5Mask))
+ modifiers |= XEMACS_MOD_BUTTON5;
+ }