[scribus-dev] Handling *all* keystrokes in canvas modes not possible?
Elvis Stansvik
elvstone at gmail.com
Wed Aug 10 11:27:32 UTC 2011
2011/8/10 Elvis Stansvik <elvstone at gmail.com>:
> 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.
I _thought_ I had found it when I found this in
ScribusMainWindow::keyPressEvent(..):
if (doc->m_Selection->count() != 0)
{
PageItem *currItem = doc->m_Selection->itemAt(0);
if (doc->appMode == modeEdit)
{
if (currItem->asImageFrame() && !currItem->locked())
{
currItem->handleModeEditKey(k, keyrep);
}
//FIXME:av view->oldCp = currItem->CPos;
if (currItem->itemType() == PageItem::TextFrame)
{
bool kr=keyrep;
view->canvasMode()->keyPressEvent(k); //Hack for 1.4.x for stopping
the cursor blinking while moving about
currItem->handleModeEditKey(k, keyrep);
keyrep=kr;
}
slotDocCh(false);
}
et.c. et.c.
I'll do some experimentation..
Elvis
More information about the scribus-dev
mailing list