let the enter key active text buttons and the unlink button
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Jul 2013 14:55:47 +0000 (14:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Jul 2013 14:55:47 +0000 (14:55 +0000)
source/blender/editors/interface/interface_handlers.c

index ee316e13dad0716e7c8e8790e0e6788e556b8a6e..ef39009766426401d26dbc058477c68f1670ee69 100644 (file)
@@ -2605,7 +2605,7 @@ static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, c
 static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
 static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val == KM_PRESS) {
+               if (ELEM4(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS) {
                        if (but->dt == UI_EMBOSSN && !event->ctrl) {
                                /* pass */
                        }
                        if (but->dt == UI_EMBOSSN && !event->ctrl) {
                                /* pass */
                        }
@@ -2630,7 +2630,7 @@ static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
 static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        /* unlink icon is on right */
 static int ui_do_but_SEARCH_UNLINK(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {
        /* unlink icon is on right */
-       if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val == KM_PRESS) {
+       if (ELEM4(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS) {
                ARegion *ar = data->region;
                rcti rect;
                int x = event->x, y = event->y;
                ARegion *ar = data->region;
                rcti rect;
                int x = event->x, y = event->y;