Ticket #13151: 0001-Make-Esc-and-Alt-Up-keys-work-for-file-panels.patch

File 0001-Make-Esc-and-Alt-Up-keys-work-for-file-panels.patch, 1.2 KB (added by owenca, 7 years ago)
  • src/kits/tracker/FilePanelPriv.cpp

    From 39e7c443dbbd1aac8e90d3133d1cc6e94cccb534 Mon Sep 17 00:00:00 2001
    From: Owen <owenca@users.noreply.github.com>
    Date: Thu, 3 Aug 2017 22:51:29 +0000
    Subject: [PATCH] Make Esc and Alt-Up keys work for file panels.
    
    Fixes #11979 and #13151
    ---
     src/kits/tracker/FilePanelPriv.cpp | 9 +++++++--
     1 file changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/src/kits/tracker/FilePanelPriv.cpp b/src/kits/tracker/FilePanelPriv.cpp
    index 59cc80d..803e722 100644
    a b key_down_filter(BMessage* message, BHandler** handler, BMessageFilter* filter)  
    129129
    130130    int32 modifier = 0;
    131131    message->FindInt32("modifiers", &modifier);
     132
     133    if (modifier & B_COMMAND_KEY && key == B_UP_ARROW) {
     134        filter->Looper()->PostMessage(kOpenParentDir);
     135        return B_SKIP_MESSAGE;
     136    }
     137
    132138    if (!modifier && key == B_ESCAPE) {
    133139        if (view->ActivePose())
    134140            view->CommitActivePose(false);
    135141        else if (view->IsFiltering())
    136142            filter->Looper()->PostMessage(B_CANCEL, *handler);
    137         else
    138             filter->Looper()->PostMessage(kCancelButton);
    139143
     144        filter->Looper()->PostMessage(kCancelButton);
    140145        return B_SKIP_MESSAGE;
    141146    }
    142147