[scribus-dev] Handling *all* keystrokes in canvas modes not possible?

Elvis Stansvik elvstone at gmail.com
Wed Aug 10 11:34:44 UTC 2011


2011/8/10 Craig Bradney <cbradney at scribus.info>:
>
>
>
>
> On 10/08/2011, at 13:22, Elvis Stansvik <elvstone at gmail.com> wrote:
>
>> 2011/8/10 Andreas Vox <andreas.vox at googlemail.com>:
>>>
>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Elvis Stansvik [mailto:elvstone at gmail.com]
>>>> Gesendet: Mittwoch, 10. August 2011 11:58
>>>> An: Scribus Development Mailing List
>>>> Betreff: [scribus-dev] Handling *all* keystrokes in canvas modes not
>>>> possible?
>>> ...
>>>>
>>>> I noticed:
>>>>
>>>> //AV -> CanvasMode
>>>> void ScribusMainWindow::keyPressEvent(QKeyEvent *k)
>>>>
>>>> I guess "AV" is you avox? Does the comment mean that there's more work
>>>> to be done here on CanvasMode-ifying the code, or was the comment just
>>>> left as a "I was here" kind of comment?
>>>
>>> That just means I think this method should be in class CanvasMode, not in
>>> class ScribusMainWindow.
>>>
>>> Are global shortcuts handled here or by Qt itself? I always thought Qt did
>>> that for us.
>>
>> I'm still trying to figure out how the different event filters,
>> keypress handlers and the actionmanager works together. Let me get
>> back to you :)
>>
>> Somewhere there must be code that makes e.g. pressing "i" go straight
>> to the text frame and not the global shortcut for inserting an image.
>> Still trying to find that piece of code.
>>
>> Elvis
>>
>> _______________________________________________
>> scribus-dev mailing list
>> scribus-dev at lists.scribus.net
>> http://lists.scribus.net/mailman/listinfo/scribus-dev
>
> Check out how we enter text edit mode and then actionmanager disables certain actions at that time.

Ah think I found it now. From ScribusMainWindow::setAppMode(..):

        if (mode!=modeEdit && oldMode==modeEdit)
            actionManager->restoreActionShortcutsPostEditMode();
        else
        if (mode==modeEdit && oldMode!=modeEdit)
            actionManager->saveActionShortcutsPreEditMode();

Thanks!

*tries*

Elvis



More information about the scribus-dev mailing list