[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : luke
Repository : xara
Revision : 1197
Date : Fri May 26 15:53:59 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/Makefile.am
M /Trunk/XaraLX/Kernel/bars.cpp
M /Trunk/XaraLX/Kernel/docview.cpp
M /Trunk/XaraLX/Kernel/guides.cpp
M /Trunk/XaraLX/Kernel/hotkeys.cpp
M /Trunk/XaraLX/Kernel/opgrad.cpp
M /Trunk/XaraLX/Kernel/tool.cpp
M /Trunk/XaraLX/Kernel/transop.cpp
M /Trunk/XaraLX/tools/filltool.cpp
M /Trunk/XaraLX/tools/selector.cpp
M /Trunk/XaraLX/tools/shadtool.cpp
M /Trunk/XaraLX/tools/slicetool.cpp
M /Trunk/XaraLX/tools/texttool.cpp
M /Trunk/XaraLX/wxOil/camelot.cpp
M /Trunk/XaraLX/wxOil/camelot.h
M /Trunk/XaraLX/wxOil/keypress.cpp
M /Trunk/XaraLX/wxOil/keypress.h
M /Trunk/XaraLX/wxOil/rendwnd.cpp
M /Trunk/XaraLX/wxOil/rendwnd.h
M /Trunk/XaraLX/wxOil/xrc/STANDARD_HOTKEYS.res
A bumper collection of key fixes, including fixes for BX#1101, BZ#1118 and F1 help fix
Diff:
Index: Trunk/XaraLX/tools/shadtool.cpp
===================================================================
--- Trunk/XaraLX/tools/shadtool.cpp (revision 1196)
+++ Trunk/XaraLX/tools/shadtool.cpp (revision 1197)
@@ -1049,7 +1049,7 @@
switch (pKey->GetVirtKey())
{
case CAMKEY(1): // toggle tool blobs
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
pSoftShadowInfoBarOp->HandleShadowTypeChange(SHADOWTYPE_NONE);
return TRUE;
@@ -1057,7 +1057,7 @@
break;
case CAMKEY(2): // toggle edit blobs
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
pSoftShadowInfoBarOp->HandleShadowTypeChange(SHADOWTYPE_WALL);
return TRUE;
@@ -1065,7 +1065,7 @@
break;
case CAMKEY(3): // toggle fill blobs
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
pSoftShadowInfoBarOp->HandleShadowTypeChange(SHADOWTYPE_FLOOR);
return TRUE;
@@ -1073,7 +1073,7 @@
break;
case CAMKEY(4): // toggle bounds/rotate blobs
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
pSoftShadowInfoBarOp->HandleShadowTypeChange(SHADOWTYPE_GLOW);
return TRUE;
@@ -1081,7 +1081,7 @@
break;
case CAMKEY(5): // toggle bounds/rotate blobs
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
pSoftShadowInfoBarOp->HandleShadowTypeChange(SHADOWTYPE_FEATHER);
return TRUE;
@@ -1089,7 +1089,7 @@
break;
case CAMKEY(A): // select all shadows only
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
pSoftShadowInfoBarOp->SelectShadowsAlone();
return TRUE;
Index: Trunk/XaraLX/tools/selector.cpp
===================================================================
--- Trunk/XaraLX/tools/selector.cpp (revision 1196)
+++ Trunk/XaraLX/tools/selector.cpp (revision 1197)
@@ -899,7 +899,7 @@
// >>>> End
case CAMKEY(TAB): // moves selection to next rendered node
- if (!pKey->IsRelease()) HandleTabKey(ClickMods.Adjust);
+ if (pKey->IsPress()) HandleTabKey(ClickMods.Adjust);
break;
case CAMKEY(1): // toggle tool blobs
@@ -909,7 +909,7 @@
// instead of 'absorbing' the keypress
return FALSE;
}
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
BoundsButtonChange();
if (pInfoBarOp != NULL)
@@ -924,7 +924,7 @@
{
return FALSE;
}
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
BlobStyle bs(TRUE);
SelectionBlobChange(bs);
@@ -940,7 +940,7 @@
{
return FALSE;
}
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
BlobStyle bs(FALSE, FALSE, TRUE);
SelectionBlobChange(bs);
@@ -952,7 +952,7 @@
break;
case CAMKEY(HOME): // select first object in render order
- if (!pKey->IsRelease())
+ if (pKey->IsPress())
{
if (SelectionSpread != NULL) NodeRenderableInk::DeselectAll();
HandleTabKey(FALSE);
@@ -960,7 +960,7 @@
break;
case CAMKEY(END): // select last object in render order
- if (!pKey->IsRelease())
+ if (pKey->IsPress())
{
if (SelectionSpread != NULL) NodeRenderableInk::DeselectAll();
HandleTabKey(TRUE);
@@ -972,7 +972,7 @@
{
return FALSE;
}
- if (!pKey->IsRelease() && !pKey->IsModified())
+ if (pKey->IsPress() && !pKey->IsModified())
{
RotateButtonChange(SelectorInfoBarOp::fRotateMode = !SelectorInfoBarOp::fRotateMode);
if (pInfoBarOp != NULL)
Index: Trunk/XaraLX/tools/texttool.cpp
===================================================================
--- Trunk/XaraLX/tools/texttool.cpp (revision 1196)
+++ Trunk/XaraLX/tools/texttool.cpp (revision 1197)
@@ -985,9 +985,13 @@
BOOL TextTool::OnKeyPress(KeyPress* pKeyPress)
{
+ TRACEUSER( "jlh92", _T("TextTool::OnKeyPress
") );
+
// Filter out all key release events
if (pKeyPress->IsRelease())
{
+ TRACEUSER( "jlh92", _T("Release
") );
+
if (GetApplication()->FindSelection()->IsSelRangeGagged())
{
GetApplication()->FindSelection()->SetGag(FALSE);
@@ -996,9 +1000,16 @@
return FALSE;
}
+ if( !pKeyPress->IsChar() )
+ return pKeyPress->GetUnicode() == _T(' ');
+
// Deal with keypresses that don't dosen't depend on a focus story
if (HandleSpecialStoryAndNonStoryKeys(pKeyPress))
+ {
+ TRACEUSER( "jlh92", _T("SpecialStoryAndNonStoryKeys
") );
+
return TRUE;
+ }
// See if a caret has been selected without updating the focus story
if (TextStory::GetFocusStory() == NULL)
@@ -1019,7 +1030,11 @@
// We need a focus story do handle a keypress
if (TextStory::GetFocusStory() == NULL)
+ {
+ TRACEUSER( "jlh92", _T("GetFocusStory
") );
+
return HandleSpecialNonStoryKeys(pKeyPress);
+ }
// Just to be safe let's see if the TextStory has a selected caret or selected region
if ( !(TextStory::GetFocusStory()->GetCaret()->IsSelected()) &&
@@ -1055,6 +1070,8 @@
// First see if this is a special meaning key
if (HandleSpecialStoryKeys(pKeyPress, TextStory::GetFocusStory(), TextStory::GetFocusStory()->GetCaret()))
{
+ TRACEUSER( "jlh92", _T("HandleSpecialStoryKeys
") );
+
return TRUE;
}
else
@@ -1064,7 +1081,7 @@
(pKeyPress->IsAlternative() && pKeyPress->IsConstrain()) ) // Ctrl & left alt down
{
WCHAR UnicodeValue = pKeyPress->GetUnicode();
- TRACEUSER("wuerthne", _T("UnicodeValue from keypress event = %04x"), UnicodeValue);
+ TRACEUSER("jlh92", _T("UnicodeValue from keypress event = %04x"), UnicodeValue);
if (HandleDeadKeys(pKeyPress, &UnicodeValue))
return TRUE;
else
@@ -1088,12 +1105,14 @@
OpTextFormat* pOp = new OpTextFormat();
if (pOp != NULL)
{
- TRACEUSER("wuerthne", _T("inserting Unicode char %04x"), UnicodeValue);
+ TRACEUSER("jlh92", _T("inserting Unicode char %04x"), UnicodeValue);
pOp->DoInsertChar(UnicodeValue, OpTextFormat::INSERT);
UpdateAfterTyping = TRUE;
return TRUE;
}
}
+ else
+ TRACEUSER( "jlh92", _T("Rejected
" ) );
}
}
}
Index: Trunk/XaraLX/tools/filltool.cpp
===================================================================
--- Trunk/XaraLX/tools/filltool.cpp (revision 1196)
+++ Trunk/XaraLX/tools/filltool.cpp (revision 1197)
@@ -1095,7 +1095,7 @@
BOOL GradFillTool::OnKeyPress(KeyPress* pKeyPress)
{
if (pKeyPress->GetVirtKey() == CAMKEY(TAB) &&
- !pKeyPress->IsRelease() &&
+ pKeyPress->IsPress() &&
!pKeyPress->IsRepeat())
{
// Toggle the selection state of all visible fill control points
@@ -2105,7 +2105,7 @@
BOOL TranspTool::OnKeyPress(KeyPress* pKeyPress)
{
if (pKeyPress->GetVirtKey() == CAMKEY(TAB) &&
- !pKeyPress->IsRelease() &&
+ pKeyPress->IsPress() &&
!pKeyPress->IsRepeat())
{
// Toggle the selection state of all visible fill control points
Index: Trunk/XaraLX/tools/slicetool.cpp
===================================================================
--- Trunk/XaraLX/tools/slicetool.cpp (revision 1196)
+++ Trunk/XaraLX/tools/slicetool.cpp (revision 1197)
@@ -1183,11 +1183,11 @@
break;
case CAMKEY(TAB): // moves selection to next rendered node
- if (!pKeyPress->IsRelease()) HandleTabKey(ClickMods.Adjust);
+ if (pKeyPress->IsPress()) HandleTabKey(ClickMods.Adjust);
break;
case CAMKEY(HOME): // select first object in render order
- if (!pKeyPress->IsRelease())
+ if (pKeyPress->IsPress())
{
if (SelectionSpread != NULL)
NodeRenderableInk::DeselectAll();
@@ -1196,7 +1196,7 @@
break;
case CAMKEY(END): // select last object in render order
- if (!pKeyPress->IsRelease())
+ if (pKeyPress->IsPress())
{
if (SelectionSpread != NULL)
NodeRenderableInk::DeselectAll();
Index: Trunk/XaraLX/Kernel/hotkeys.cpp
===================================================================
--- Trunk/XaraLX/Kernel/hotkeys.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/hotkeys.cpp (revision 1197)
@@ -331,6 +331,9 @@
BOOL HotKey::OnKeyPress(KeyPress* pKeyPress)
{
+ TRACEUSER( "jlh92", _T("Key VK=%04x (%08x) in Hotkey
"), pKeyPress->GetVirtKey(),
+ pKeyPress->GetUnicode() );
+
BOOL Processed = FALSE;
BOOL DuringADrag = (Operation::GetCurrentDragOp() != NULL ||
PORTNOTE( "other", "Removed DragManagerOp usage" )
@@ -344,11 +347,11 @@
{
if (DoesHotKeyMatchKeyPress(pHotKey,pKeyPress))
{
- TRACEUSER( "luke", _T("Key VK=%04x (%08x) handled as HotKey
"), pKeyPress->GetVirtKey(),
+ TRACEUSER( "jlh92", _T("Key VK=%04x (%08x) handled as HotKey
"), pKeyPress->GetVirtKey(),
pKeyPress->GetUnicode() );
// The key press is a hot key combination
- if ((pHotKey->pKeyPress->IsOkInDrags() || !DuringADrag) && !pKeyPress->IsRelease())
+ if ((pHotKey->pKeyPress->IsOkInDrags() || !DuringADrag) && pKeyPress->IsPress())
{
// There is no drag happening (or the keypress works in drags), and it is a "key down" key press
// If the hot key's op is enabled, invoke it
Index: Trunk/XaraLX/Kernel/docview.cpp
===================================================================
--- Trunk/XaraLX/Kernel/docview.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/docview.cpp (revision 1197)
@@ -3497,7 +3497,7 @@
if (pCurrentDragOp != NULL)
{
// Handle the TAB key out here on behalf of ALL drag ops
- if (m_bSolidDragSupported && !pKeyPress->IsRelease() && !pKeyPress->IsRepeat()) // I.e. is this a non-auto-repeated key-down event?
+ if (m_bSolidDragSupported && pKeyPress->IsPress() && !pKeyPress->IsRepeat()) // I.e. is this a non-auto-repeated key-down event?
{
switch (pKeyPress->GetVirtKey())
{
Index: Trunk/XaraLX/Kernel/bars.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bars.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/bars.cpp (revision 1197)
@@ -2248,17 +2248,17 @@
if( KMsg->pKeyPress->GetVirtKey() == CAMKEY(ESCAPE) ||
KMsg->pKeyPress->GetVirtKey() == CAMKEY(CANCEL) )
{
- if(BaseBar::EscPressed(!KMsg->pKeyPress->IsRelease()))
+ if(BaseBar::EscPressed( KMsg->pKeyPress->IsPress() ))
return EAT_MSG;
}
else if( KMsg->pKeyPress->GetVirtKey() == CAMKEY(CONTROL) )
{
- if(BaseBar::CtlPressed(!KMsg->pKeyPress->IsRelease()))
+ if(BaseBar::CtlPressed( KMsg->pKeyPress->IsPress() ))
return EAT_MSG;
}
else if( KMsg->pKeyPress->GetVirtKey() == CAMKEY(MENU) )
{
- if(BaseBar::AltPressed(!KMsg->pKeyPress->IsRelease()))
+ if(BaseBar::AltPressed( KMsg->pKeyPress->IsPress() ))
return EAT_MSG;
}
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am (revision 1196)
+++ Trunk/XaraLX/Kernel/Makefile.am (revision 1197)
@@ -16,8 +16,8 @@
colcomp.cpp colcontx.cpp collist.cpp colormgr.cpp colourix.cpp colplate.cpp \
coord.cpp cutop.cpp cxfellp.cpp cxfile.cpp cxflists.cpp cxfmap.cpp \
cxfnbmp.cpp cxfpoly.cpp cxfrec.cpp cxfrech.cpp cxfrect.cpp cxfrgshp.cpp \
- cxftext.cpp cxftfile.cpp cxftrans.cpp dbugtree.cpp dialogop.cpp doccolor.cpp \
- doccomp.cpp doccoord.cpp docrect.cpp document.cpp docview.cpp dumbnode.cpp \
+ cxftext.cpp cxftfile.cpp cxftrans.cpp dbugtree.cpp debugdlg.cpp dialogop.cpp \
+ doccolor.cpp doccomp.cpp doccoord.cpp docrect.cpp document.cpp docview.cpp dumbnode.cpp \
cpp exphint.cpp extender.cpp fillattr.cpp fillramp.cpp \
fillval.cpp filters.cpp filtimag.cpp filtimop.cpp filtrmgr.cpp fontcomp.cpp fontlist.cpp \
fontman.cpp fracfill.cpp fthrattr.cpp gcache.cpp fntcache.cpp textacts.cpp \
Index: Trunk/XaraLX/Kernel/transop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/transop.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/transop.cpp (revision 1197)
@@ -1372,7 +1372,7 @@
ClickMods.Alternative2 = FALSE;
ClickMods.Pressure = 0;
- if (!pKeyPress->IsRelease() && !pKeyPress->IsRepeat()) // I.e. is this a non-auto-repeated key-down event?
+ if (pKeyPress->IsPress() && !pKeyPress->IsRepeat()) // I.e. is this a non-auto-repeated key-down event?
{
switch (pKeyPress->GetVirtKey())
{
Index: Trunk/XaraLX/Kernel/guides.cpp
===================================================================
--- Trunk/XaraLX/Kernel/guides.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/guides.cpp (revision 1197)
@@ -1656,7 +1656,7 @@
switch (pKeyPress->GetVirtKey())
{
case CAMKEY(ADD):
- if (!pKeyPress->IsModified() && !pKeyPress->IsRelease() && !pKeyPress->IsRepeat())
+ if (!pKeyPress->IsModified() && pKeyPress->IsPress() && !pKeyPress->IsRepeat())
{
LeaveCopy = !LeaveCopy;
UpdateStatusLineAndPointer();
Index: Trunk/XaraLX/Kernel/opgrad.cpp
===================================================================
--- Trunk/XaraLX/Kernel/opgrad.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/opgrad.cpp (revision 1197)
@@ -936,7 +936,7 @@
BOOL OpEditFill::DragKeyPress(KeyPress* pKeyPress, BOOL bSolidDrag)
{
if (pKeyPress->GetVirtKey() == CAMKEY(TAB) &&
- !pKeyPress->IsRelease() &&
+ pKeyPress->IsPress() &&
!pKeyPress->IsRepeat())
{
// Toggle the continuous EOR flag
Index: Trunk/XaraLX/Kernel/tool.cpp
===================================================================
--- Trunk/XaraLX/Kernel/tool.cpp (revision 1196)
+++ Trunk/XaraLX/Kernel/tool.cpp (revision 1197)
@@ -979,7 +979,7 @@
Tool* pTool = pToolSwitch->pTool;
// Is it a "key down" key press?
- if (!pKeyPress->IsRelease())
+ if (pKeyPress->IsPress())
{
// It's a "key down" event
Index: Trunk/XaraLX/wxOil/rendwnd.cpp
===================================================================
--- Trunk/XaraLX/wxOil/rendwnd.cpp (revision 1196)
+++ Trunk/XaraLX/wxOil/rendwnd.cpp (revision 1197)
@@ -143,6 +143,7 @@
EVT_SET_CURSOR( CRenderWnd::OnSetCursor )
EVT_KEY_DOWN( CRenderWnd::OnKey)
EVT_KEY_UP( CRenderWnd::OnKey)
+ EVT_CHAR( CRenderWnd::OnChar)
#if defined(__WXGTK__)
EVT_ENTER_WINDOW( CRenderWnd::OnEnter )
@@ -396,7 +397,14 @@
event.Skip(); // Pass the key event on to someone who really wants it.
}
+void CRenderWnd::OnChar( wxKeyEvent & event )
+{
+ TRACEUSER( "jlh92", _T("CRenderWnd::OnChar \"%c\"
"), event.GetUnicodeKey() );
+ if( !AfxGetApp().HandleKeyPress( event ) )
+ event.Skip(); // Pass the key event on to someone who really wants it.
+}
+
/*********************************************************************************************
> afx_msg void CRenderWnd::OnRButtonDown(UINT32, CPoint)
Index: Trunk/XaraLX/wxOil/rendwnd.h
===================================================================
--- Trunk/XaraLX/wxOil/rendwnd.h (revision 1196)
+++ Trunk/XaraLX/wxOil/rendwnd.h (revision 1197)
@@ -171,6 +171,7 @@
#endif
void OnKey ( wxKeyEvent & event);
+ void OnChar( wxKeyEvent& event );
protected:
CCamView* m_pView;
Index: Trunk/XaraLX/wxOil/camelot.h
===================================================================
--- Trunk/XaraLX/wxOil/camelot.h (revision 1196)
+++ Trunk/XaraLX/wxOil/camelot.h (revision 1197)
@@ -138,6 +138,8 @@
void OnIdle ( wxIdleEvent &event );
void OnTimer ( wxTimerEvent &event );
+ bool HandleKeyPress( wxKeyEvent &event );
+
void OnHelpIndex();
void GiveActiveCanvasFocus();
Index: Trunk/XaraLX/wxOil/keypress.h
===================================================================
--- Trunk/XaraLX/wxOil/keypress.h (revision 1196)
+++ Trunk/XaraLX/wxOil/keypress.h (revision 1197)
@@ -239,6 +239,8 @@
BOOL IsRepeat() { return Repeat; }
BOOL IsRightHand() { return RightHand; }
BOOL IsRelease() { return Release; }
+ BOOL IsChar() { return m_fIsChar; }
+ BOOL IsPress() { return !m_fIsChar && !Release; }
BOOL IsOkInDrags() { return WorksInDrag; }
// The all-important equivalence operator
@@ -284,6 +286,7 @@
BOOL Repeat : 1; // The key press was generated by an auto-repeat (i.e. not the original keypress)
BOOL RightHand : 1; // The key press was generated by a right-hand equivelent (e.g. 'Enter' and not 'Return')
BOOL Release : 1; // The key has just been released (e.g. Windows KEYUP event)
+ BOOL m_fIsChar : 1;
BOOL Valid : 1; // Validity bit. Set means object is ok, clear means DON'T TOUCH IT!
BOOL WorksInDrag : 1; // TRUE if this keypress will work in the middle of a drag
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp (revision 1196)
+++ Trunk/XaraLX/wxOil/camelot.cpp (revision 1197)
@@ -323,17 +323,11 @@
pWnd = pWnd->GetParent();
}
- // Make sure the kernel knows which view/doc the event applies to, if any.
- if( NULL != Document::GetSelected() )
- Document::GetSelected()->SetCurrent();
- if( NULL != DocView::GetSelected() )
- DocView::GetSelected()->SetCurrent();
-
TRACEUSER( "jlh92", _T("Handled!
") );
// Process keyboard messages (and mark event as handled)
- if( !CCamFrame::GetMainFrame()->IsIconized() && KeyPress::TranslateMessage( (wxKeyEvent*)&event ) )
- return true;
+ if( HandleKeyPress( (wxKeyEvent&)event ) )
+ return -1;
}
return -1;
@@ -872,6 +866,32 @@
/********************************************************************************************
+> void CCamApp::HandleKeyPress( wxKeyEvent& event )
+
+ Author: Luke_Hart (Xara Group Ltd) <lukeh@xxxxxxxx>
+ Created: 22/05/06
+ Inputs: event - The key \ char event to handle
+ Returns: true if handled else false
+ Purpose: Central handler for key and char events, using KeyPress class to route
+ events to the areas of code that need to handle them
+
+********************************************************************************************/
+
+bool CCamApp::HandleKeyPress( wxKeyEvent& event )
+{
+ // Make sure the kernel knows which view/doc the event applies to, if any.
+ if( NULL != Document::GetSelected() )
+ Document::GetSelected()->SetCurrent();
+ if( NULL != DocView::GetSelected() )
+ DocView::GetSelected()->SetCurrent();
+
+ // Process keyboard messages (returning true if it was)
+ return !CCamFrame::GetMainFrame()->IsIconized() && KeyPress::TranslateMessage( (wxKeyEvent*)&event );
+}
+
+
+/********************************************************************************************
+
> void CCamApp::OnRecentFile(INT32 RecentFileNumber)
Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xxxxxxxx>
Index: Trunk/XaraLX/wxOil/keypress.cpp
===================================================================
--- Trunk/XaraLX/wxOil/keypress.cpp (revision 1196)
+++ Trunk/XaraLX/wxOil/keypress.cpp (revision 1197)
@@ -161,6 +161,7 @@
{CAMKEY(MENU), CAMELOT_UNICODE_BASE + 26},
{CAMKEY(DELETE), CAMELOT_UNICODE_BASE + 28},
+ {CAMKEY(NUMPAD_DELETE), CAMELOT_UNICODE_BASE + 28},
{CAMKEY(INSERT), CAMELOT_UNICODE_BASE + 27},
{CAMKEY(HOME), CAMELOT_UNICODE_BASE + 29},
{CAMKEY(END), CAMELOT_UNICODE_BASE + 30},
@@ -328,7 +329,8 @@
Extended = VirtKey >= WXK_START;
PrevDown = m_LastVirtKey == VirtKey;
#if FALSE != wxUSE_UNICODE
- m_Char = pMsg->GetRawKeyCode();
+ m_Char = pMsg->GetUnicodeKey();
+ TRACEUSER( "jlh92", _T("m_Char = %04x Ext=%d
"), m_Char, Extended );
#endif
#endif
// Update the last virtual keycode if not a modifier
@@ -504,6 +506,7 @@
Repeat = pKeySysMsg->PrevDown;
RightHand = pKeySysMsg->Extended;
Release = (pKeySysMsg->Message == KM_KEYUP);
+ m_fIsChar = (pKeySysMsg->Message == KM_CHAR);
Valid = TRUE; // This is now a valid KeyPress object.
}
@@ -630,6 +633,7 @@
Repeat = FALSE;
RightHand = FALSE;
Release = FALSE;
+ m_fIsChar = FALSE;
// This is an invalid KeyPress object at the moment
Valid = FALSE;
@@ -937,6 +941,12 @@
if (pKeySysMsg->Message == KM_CHAR)
{
+#if FALSE != wxUSE_UNICODE
+ NumChars = 1;
+ pWideChar[0] = pKeySysMsg->m_Char;
+
+ TRACEUSER( "jlh92", _T("Unicode = %c
"), pKeySysMsg->m_Char );
+#else
// If the message is a CHAR message, then we need to generate a Unicode value ourselves
// using the char code (which is stored in the VirtKey field of the KeyPressSysMsg class)
//
@@ -984,6 +994,7 @@
pKeySysMsg->VirtKey = CAMKEY(CC_NONE);
NumChars = 1;
+#endif
}
else
{
@@ -1408,7 +1419,7 @@
UINT32 VirtKey = pKeyPress->GetVirtKey();
// Only check non-auto-repeat "key down" key presses
- if (!pKeyPress->IsRelease() && !pKeyPress->IsRepeat())
+ if (pKeyPress->IsPress() && !pKeyPress->IsRepeat())
{
if (VirtKey == CAMKEY(ESCAPE) || VirtKey == WXK_CANCEL)
{
@@ -1620,7 +1631,8 @@
#endif
TRACEUSER( "jlh92", _T("TM - %s
"), wxEVT_KEY_DOWN == pMsg->GetEventType() ? _T("KDN") :
- wxEVT_KEY_UP == pMsg->GetEventType() ? _T("KUP") : _T("K??") );
+ wxEVT_KEY_UP == pMsg->GetEventType() ? _T("KUP") : wxEVT_CHAR == pMsg->GetEventType() ? _T("KCH") :
+ _T("K??") );
// Normal key processing.
KeyPress* pKeyPress;
Index: Trunk/XaraLX/wxOil/xrc/STANDARD_HOTKEYS.res
===================================================================
--- Trunk/XaraLX/wxOil/xrc/STANDARD_HOTKEYS.res (revision 1196)
+++ Trunk/XaraLX/wxOil/xrc/STANDARD_HOTKEYS.res (revision 1197)
@@ -54,9 +54,9 @@
HotKey 0x7F Adjust "Shift+Delete" "Cut"
HotKey 0x7F Extended Adjust "Shift+Delete" "Cut"
HotKey 0x13D "NumPad 8" "ViewFullScreen"
-HotKey 0x70 "F1" "HelpIndex"
+HotKey 0x156 Extended "F1" "HelpIndex"
HotKey 0x187 WorksInDrag "NumPad *" "SnapToObjects"
-HotKey 0x185 WorksInDrag "NumPad ." "SnapToGrid"
+HotKey 0x185 WorksInDrag Extended "NumPad ." "SnapToGrid"
HotKey 0x17D WorksInDrag "NumPad 2" "SnapToGuides"
HotKey 0x182 "NumPad 1" "ShowGuides"
HotKey 0x31 Constrain "Ctrl+1" "AddShapes"
Xara