2007-08-30 08:15:05 +00:00
|
|
|
/*******************/
|
|
|
|
/* hotkeys_basic.h */
|
|
|
|
/*******************/
|
2007-08-20 11:33:45 +00:00
|
|
|
|
|
|
|
/* Some functions to handle hotkeys in kicad
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2007-08-20 11:33:45 +00:00
|
|
|
|
|
|
|
#ifndef HOTKEYS_BASIC_H
|
|
|
|
#define HOTKEYS_BASIC_H
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( ".key" )
|
2007-08-21 19:37:31 +00:00
|
|
|
|
|
|
|
/* define default path for config key file */
|
|
|
|
#ifdef __WINDOWS__
|
2007-08-30 08:15:05 +00:00
|
|
|
#define DEFAULT_HOTKEY_FILENAME_PATH EDA_Appl->m_BinDir + wxT( "../template/" )
|
2007-08-21 19:37:31 +00:00
|
|
|
#else
|
2007-08-30 08:15:05 +00:00
|
|
|
#define DEFAULT_HOTKEY_FILENAME_PATH wxGetHomeDir() + wxT( "/" )
|
2007-08-21 19:37:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2007-08-20 11:33:45 +00:00
|
|
|
/* Class to handle hotkey commnands. hotkeys have a default value
|
2007-08-30 08:15:05 +00:00
|
|
|
* This class allows (for the future..) the real key code changed by user(from a key code list file, TODO)
|
|
|
|
*/
|
2007-08-20 11:33:45 +00:00
|
|
|
class Ki_HotkeyInfo
|
|
|
|
{
|
|
|
|
public:
|
2007-08-30 08:15:05 +00:00
|
|
|
int m_KeyCode; // Key code (ascii value for ascii keys or wxWidgets code for function key
|
|
|
|
wxString m_InfoMsg; // info message.
|
|
|
|
int m_Idcommand; // internal id for the corresponding command (see hotkey_id_commnand list)
|
2007-08-20 11:33:45 +00:00
|
|
|
|
|
|
|
public:
|
2007-08-30 08:15:05 +00:00
|
|
|
Ki_HotkeyInfo( const wxChar* infomsg, int idcommand, int keycode );
|
2007-08-20 11:33:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Functions:
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
|
|
|
wxString ReturnKeyNameFromKeyCode( int keycode );
|
|
|
|
wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** List, int CommandId );
|
|
|
|
wxString AddHotkeyName( const wxString& text, Ki_HotkeyInfo** List, int CommandId );
|
|
|
|
void DisplayHotkeyList( WinEDA_DrawFrame* frame, Ki_HotkeyInfo** List );
|
|
|
|
int GetCommandCodeFromHotkey( int key, Ki_HotkeyInfo** List );
|
2007-08-20 11:33:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif // HOTKEYS_BASIC_H
|