[scribus-dev] Handling *all* keystrokes in canvas modes not possible?
Craig Bradney
cbradney at scribus.info
Wed Aug 10 12:16:55 UTC 2011
On 10/08/2011, at 13:34, Elvis Stansvik <elvstone at gmail.com> wrote:
> 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
>
> _______________________________________________
> scribus-dev mailing list
> scribus-dev at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus-dev
When I did the actions the action contexts were not in qt afaik, and I still don't think they work well with the current scribus GUI but I think we need to revisit them. You might find some guidance in the qaction docs that could help you and scribus in general.
Craig
More information about the scribus-dev
mailing list