From 4feef88fc614e9c5717ef9b5a1b378c991934859 Mon Sep 17 00:00:00 2001 From: CHARRAS Date: Sat, 11 Aug 2007 11:23:53 +0000 Subject: [PATCH] modify Hotkey.cpp code for eeschema --- change_log.txt | 5 +++++ eeschema/hotkeys.cpp | 14 ++++++++++++-- include/common.h | 12 ++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/change_log.txt b/change_log.txt index 122a5268f6..7982f04323 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,11 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2007-aug-11 UPDATE Jean-Pierre Charras +================================================================================ ++ eeschema + modify hotkeys.cpp code. + 2007-aug-10 UPDATE Jean-Pierre Charras ================================================================================ + eeschema diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 7170d15a30..4add925e27 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -17,6 +17,7 @@ enum hotkey_id_commnand { HK_NOT_FOUND = 0, + HK_RESET_LOCAL_COORD, HK_HELP, HK_ZOOM_IN, HK_ZOOM_OUT, @@ -68,6 +69,7 @@ static Ki_HotkeyInfo HkMoveComponent(wxT("Move Component"), HK_MOVE_COMPONENT, ' static Ki_HotkeyInfo HkMove2Drag(wxT("Switch move block to drag block"), HK_MOVEBLOCK_TO_DRAGBLOCK, '\t'); static Ki_HotkeyInfo HkInsert(wxT("Repeat Last Item"), HK_REPEAT_LAST, WXK_INSERT); static Ki_HotkeyInfo HkDelete(wxT("Delete Item"), HK_DELETE, WXK_DELETE); +static Ki_HotkeyInfo HkResetLocalCoord(wxT("Reset local coord."), HK_RESET_LOCAL_COORD, ' '); static Ki_HotkeyInfo HkNextSearch(wxT("Next Search"), HK_NEXT_SEARCH, WXK_F5); static Ki_HotkeyInfo HkZoomCenter(wxT("Zoom Center"), HK_ZOOM_CENTER, WXK_F4); static Ki_HotkeyInfo HkZoomRedraw(wxT("Zoom Redraw"), HK_ZOOM_REDRAW, WXK_F3); @@ -79,7 +81,8 @@ static Ki_HotkeyInfo HkHelp(wxT("Help: this message"), HK_HELP, '?'); static Ki_HotkeyInfo *s_Schematic_Hotkey_List[] = { &HkHelp, &HkZoomIn, &HkZoomOut, &HkZoomRedraw, &HkZoomCenter, - &HkNextSearch, &HkDelete, &HkInsert, &HkMove2Drag, + &HkNextSearch, &HkResetLocalCoord, + &HkDelete, &HkInsert, &HkMove2Drag, &HkMoveComponent, &HkAddComponent, &HkRotateComponent, &HkMirrorXComponent, &HkMirrorYComponent, & HkOrientNormalComponent, &HkBeginWire, @@ -95,6 +98,7 @@ static Ki_HotkeyInfo *s_LibEdit_Hotkey_List[] = { &HkHelp, &HkZoomIn, &HkZoomOut, &HkZoomRedraw, &HkZoomCenter, + &HkResetLocalCoord, &HkInsertPin, NULL }; @@ -138,6 +142,10 @@ wxString keyname, modifier, fullkeyname; keyname.Printf(wxT("F%d"), keycode - WXK_F1 + 1); break; + case ' ': + keyname = wxT("space"); + break; + case '\t': keyname = wxT("Tab"); break; @@ -174,7 +182,7 @@ wxString keyname; if ( hk_decr->m_InfoMsg.IsEmpty() ) break; msg += _("key "); keyname = ReturnKeyNameFromKeyCode(hk_decr->m_KeyCode); - msg += keyname + wxT(": ") + hk_decr->m_InfoMsg + wxT("\n"); + msg += keyname + wxT(": ") + hk_decr->m_InfoMsg + wxT("\n"); } DisplayInfo(frame, msg); } @@ -234,6 +242,7 @@ wxPoint MousePos = m_CurrentScreen->m_MousePosition; case HK_ZOOM_OUT: case HK_ZOOM_REDRAW: case HK_ZOOM_CENTER: + case HK_RESET_LOCAL_COORD: break; case HK_MOVEBLOCK_TO_DRAGBLOCK: // Switch to drag mode, when block moving @@ -419,6 +428,7 @@ wxPoint MousePos = m_CurrentScreen->m_MousePosition; case HK_ZOOM_OUT: case HK_ZOOM_REDRAW: case HK_ZOOM_CENTER: + case HK_RESET_LOCAL_COORD: break; case HK_REPEAT_LAST: diff --git a/include/common.h b/include/common.h index 12e0595689..3a44afcf7e 100644 --- a/include/common.h +++ b/include/common.h @@ -18,14 +18,10 @@ /* Etat des touches speciales du clavier */ -#define GR_KB_RIGHTSHIFT 0x0100 /* Keybd states: right shift key depressed */ -#define GR_KB_LEFTSHIFT 0x0200 /* left shift key depressed */ -#define GR_KB_CTRL 0x0400 /* CTRL depressed */ -#define GR_KB_ALT 0x0800 /* ALT depressed */ -#define GR_KB_SCROLLOCK 0x1000 /* SCROLL LOCK active */ -#define GR_KB_NUMLOCK 0x2000 /* NUM LOCK active */ -#define GR_KB_CAPSLOCK 0x4000 /* CAPS LOCK active */ -#define GR_KB_INSERT 0x8000 /* INSERT state active */ +#define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right shift key depressed */ +#define GR_KB_LEFTSHIFT 0x20000000 /* left shift key depressed */ +#define GR_KB_CTRL 0x40000000 /* CTRL depressed */ +#define GR_KB_ALT 0x80000000 /* ALT depressed */ #define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT) #define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL) #define MOUSE_MIDDLE 0x10000 /* flag indiquant bouton central souris */