Files

508 lines
16 KiB
C++
Raw Permalink Normal View History

2011-10-18 15:59:19 -04:00
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
2020-12-19 11:00:52 -05:00
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
2011-10-18 15:59:19 -04:00
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
2021-09-14 23:45:14 +01:00
#include <kiface_base.h>
#include <hotkeys_basic.h>
#include <id.h>
2021-07-29 10:56:22 +01:00
#include <string_utils.h>
2018-01-29 16:39:40 +01:00
#include <eda_base_frame.h>
#include <eda_draw_frame.h>
2021-07-28 13:25:40 -04:00
#include <wildcards_and_files_ext.h>
#include <paths.h>
#include <tool/tool_manager.h>
#include "dialogs/dialog_hotkey_list.h"
#include <wx/apptrait.h>
#include <wx/stdpaths.h>
2010-08-28 20:02:24 +02:00
#include <wx/tokenzr.h>
2020-12-12 09:50:52 -05:00
#include <wx/txtstrm.h>
#include <wx/wfstream.h>
2019-06-09 22:57:23 +01:00
#include <tool/tool_action.h>
2007-08-20 11:33:45 +00:00
2019-06-12 15:39:47 +01:00
/*
* class to handle the printable name and the keycode
2007-08-30 08:15:05 +00:00
*/
struct hotkey_name_descr
{
const wxChar* m_Name;
2010-01-20 18:59:46 +00:00
int m_KeyCode;
};
2021-07-28 13:25:40 -04:00
2010-08-28 20:02:24 +02:00
/* table giving the hotkey name from the hotkey code, for special keys
* Note : when modifiers (ATL, SHIFT, CTRL) do not modify
* the code of the key, do need to enter the modified key code
* For instance wxT( "F1" ), WXK_F1 handle F1, AltF1, CtrlF1 ...
2010-08-29 18:36:52 +02:00
* Key names are:
* "Space","Ctrl+Space","Alt+Space" or
* "Alt+A","Ctrl+F1", ...
2010-08-28 20:02:24 +02:00
*/
#define KEY_NON_FOUND -1
static struct hotkey_name_descr hotkeyNameList[] =
2007-08-30 08:15:05 +00:00
{
{ wxT( "F1" ), WXK_F1 },
{ wxT( "F2" ), WXK_F2 },
{ wxT( "F3" ), WXK_F3 },
{ wxT( "F4" ), WXK_F4 },
{ wxT( "F5" ), WXK_F5 },
{ wxT( "F6" ), WXK_F6 },
{ wxT( "F7" ), WXK_F7 },
{ wxT( "F8" ), WXK_F8 },
{ wxT( "F9" ), WXK_F9 },
{ wxT( "F10" ), WXK_F10 },
{ wxT( "F11" ), WXK_F11 },
{ wxT( "F12" ), WXK_F12 },
{ wxT( "F13" ), WXK_F13 },
{ wxT( "F14" ), WXK_F14 },
{ wxT( "F15" ), WXK_F15 },
{ wxT( "F16" ), WXK_F16 },
{ wxT( "F17" ), WXK_F17 },
{ wxT( "F18" ), WXK_F18 },
{ wxT( "F19" ), WXK_F19 },
{ wxT( "F20" ), WXK_F20 },
{ wxT( "F21" ), WXK_F21 },
{ wxT( "F22" ), WXK_F22 },
{ wxT( "F23" ), WXK_F23 },
{ wxT( "F24" ), WXK_F24 },
{ wxT( "Esc" ), WXK_ESCAPE },
{ wxT( "Del" ), WXK_DELETE },
{ wxT( "Tab" ), WXK_TAB },
{ wxT( "Back" ), WXK_BACK },
{ wxT( "Ins" ), WXK_INSERT },
{ wxT( "Home" ), WXK_HOME },
{ wxT( "End" ), WXK_END },
{ wxT( "PgUp" ), WXK_PAGEUP },
{ wxT( "PgDn" ), WXK_PAGEDOWN },
{ wxT( "Up" ), WXK_UP },
{ wxT( "Down" ), WXK_DOWN },
{ wxT( "Left" ), WXK_LEFT },
{ wxT( "Right" ), WXK_RIGHT },
{ wxT( "Return" ), WXK_RETURN },
{ wxT( "Space" ), WXK_SPACE },
{ wxT( "Num Pad 0" ), WXK_NUMPAD0 },
{ wxT( "Num Pad 1" ), WXK_NUMPAD1 },
{ wxT( "Num Pad 2" ), WXK_NUMPAD2 },
{ wxT( "Num Pad 3" ), WXK_NUMPAD3 },
{ wxT( "Num Pad 4" ), WXK_NUMPAD4 },
{ wxT( "Num Pad 5" ), WXK_NUMPAD5 },
{ wxT( "Num Pad 6" ), WXK_NUMPAD6 },
{ wxT( "Num Pad 7" ), WXK_NUMPAD7 },
{ wxT( "Num Pad 8" ), WXK_NUMPAD8 },
{ wxT( "Num Pad 9" ), WXK_NUMPAD9 },
{ wxT( "Num Pad +" ), WXK_NUMPAD_ADD },
{ wxT( "Num Pad -" ), WXK_NUMPAD_SUBTRACT },
{ wxT( "Num Pad *" ), WXK_NUMPAD_MULTIPLY },
{ wxT( "Num Pad /" ), WXK_NUMPAD_DIVIDE },
{ wxT( "Num Pad ." ), WXK_NUMPAD_SEPARATOR },
{ wxT( "Num Pad Enter" ), WXK_NUMPAD_ENTER },
{ wxT( "Num Pad F1"), WXK_NUMPAD_F1 },
{ wxT( "Num Pad F2"), WXK_NUMPAD_F2 },
{ wxT( "Num Pad F3"), WXK_NUMPAD_F3 },
{ wxT( "Num Pad F4"), WXK_NUMPAD_F4 },
{ wxT( "" ), 0 },
{ wxT( "Click" ), PSEUDO_WXK_CLICK },
{ wxT( "DblClick" ), PSEUDO_WXK_DBLCLICK },
{ wxT( "Wheel" ), PSEUDO_WXK_WHEEL },
2019-06-12 15:39:47 +01:00
2010-01-20 18:59:46 +00:00
// Do not change this line: end of list
{ wxT( "" ), KEY_NON_FOUND }
};
2021-07-28 13:25:40 -04:00
// name of modifier keys.
// Note: the Ctrl key is Cmd key on Mac OS X.
// However, in wxWidgets defs, the key WXK_CONTROL is the Cmd key,
// so the code using WXK_CONTROL should be ok on any system.
// (on Mac OS X the actual Ctrl key code is WXK_RAW_CONTROL)
#ifdef __WXMAC__
#define USING_MAC_CMD
#endif
#ifdef USING_MAC_CMD
#define MODIFIER_CTRL wxT( "Cmd+" )
2021-09-09 10:46:52 -07:00
#define MODIFIER_ALT wxT( "Option+" )
#else
#define MODIFIER_CTRL wxT( "Ctrl+" )
2021-09-09 10:46:52 -07:00
#define MODIFIER_ALT wxT( "Alt+" )
#endif
#define MODIFIER_CMD_MAC wxT( "Cmd+" )
#define MODIFIER_CTRL_BASE wxT( "Ctrl+" )
#define MODIFIER_SHIFT wxT( "Shift+" )
2010-08-28 21:08:58 +02:00
wxString KeyNameFromKeyCode( int aKeycode, bool* aIsFound )
2007-08-20 11:33:45 +00:00
{
2007-08-30 08:15:05 +00:00
wxString keyname, modifier, fullkeyname;
int ii;
2010-08-28 20:02:24 +02:00
bool found = false;
2007-08-30 08:15:05 +00:00
if( aKeycode == WXK_CONTROL )
return wxString( MODIFIER_CTRL ).BeforeFirst( '+' );
else if( aKeycode == WXK_RAW_CONTROL )
return wxString( MODIFIER_CTRL_BASE ).BeforeFirst( '+' );
else if( aKeycode == WXK_SHIFT )
return wxString( MODIFIER_SHIFT ).BeforeFirst( '+' );
else if( aKeycode == WXK_ALT )
return wxString( MODIFIER_ALT ).BeforeFirst( '+' );
// Assume keycode of 0 is "unassigned"
2019-06-09 22:57:23 +01:00
if( (aKeycode & MD_CTRL) != 0 )
2010-08-28 21:08:58 +02:00
modifier << MODIFIER_CTRL;
2019-06-09 22:57:23 +01:00
if( (aKeycode & MD_ALT) != 0 )
2010-08-28 21:08:58 +02:00
modifier << MODIFIER_ALT;
2019-06-09 22:57:23 +01:00
if( (aKeycode & MD_SHIFT) != 0 )
2010-08-28 21:08:58 +02:00
modifier << MODIFIER_SHIFT;
2007-08-30 08:15:05 +00:00
2019-06-09 22:57:23 +01:00
aKeycode &= ~( MD_CTRL | MD_ALT | MD_SHIFT );
2010-08-28 20:02:24 +02:00
2010-08-29 18:36:52 +02:00
if( (aKeycode > ' ') && (aKeycode < 0x7F ) )
2007-08-30 08:15:05 +00:00
{
2010-08-28 20:02:24 +02:00
found = true;
keyname.Append( (wxChar)aKeycode );
2010-08-28 20:02:24 +02:00
}
else
{
for( ii = 0; ; ii++ )
2007-08-30 08:15:05 +00:00
{
if( hotkeyNameList[ii].m_KeyCode == KEY_NON_FOUND ) // End of list
2010-08-28 20:02:24 +02:00
{
keyname = wxT( "<unknown>" );
break;
}
2011-09-29 12:49:40 -04:00
if( hotkeyNameList[ii].m_KeyCode == aKeycode )
2010-08-28 20:02:24 +02:00
{
keyname = hotkeyNameList[ii].m_Name;
2010-08-28 20:02:24 +02:00
found = true;
break;
}
2007-08-30 08:15:05 +00:00
}
}
2010-08-28 20:02:24 +02:00
if( aIsFound )
*aIsFound = found;
2007-08-30 08:15:05 +00:00
fullkeyname = modifier + keyname;
return fullkeyname;
}
2007-08-20 11:33:45 +00:00
2007-08-30 08:15:05 +00:00
2019-06-09 22:57:23 +01:00
wxString AddHotkeyName( const wxString& aText, int aHotKey, HOTKEY_ACTION_TYPE aStyle )
2007-08-30 08:15:05 +00:00
{
2010-08-28 20:02:24 +02:00
wxString msg = aText;
2019-06-09 22:57:23 +01:00
wxString keyname = KeyNameFromKeyCode( aHotKey );
2007-08-30 08:15:05 +00:00
if( !keyname.IsEmpty() )
{
2019-06-09 22:57:23 +01:00
switch( aStyle )
{
2014-10-17 10:36:47 -04:00
case IS_HOTKEY:
2019-06-11 14:40:54 +01:00
{
// Don't add a suffix for unassigned hotkeys:
// WX spews debug from wxAcceleratorEntry::ParseAccel if it doesn't
2020-12-19 11:00:52 -05:00
// recognize the keyname, which is the case for <unassigned>.
2019-06-11 14:40:54 +01:00
if( aHotKey != 0 )
{
msg << wxT( "\t" ) << keyname;
}
2014-10-17 10:36:47 -04:00
break;
2019-06-11 14:40:54 +01:00
}
2014-10-17 10:36:47 -04:00
case IS_COMMENT:
2019-06-11 14:40:54 +01:00
{
2014-10-17 10:36:47 -04:00
msg << wxT( " (" ) << keyname << wxT( ")" );
break;
}
2019-06-11 14:40:54 +01:00
}
}
#ifdef USING_MAC_CMD
// On OSX, the modifier equivalent to the Ctrl key of PCs
// is the Cmd key, but in code we should use Ctrl as prefix in menus
msg.Replace( MODIFIER_CMD_MAC, MODIFIER_CTRL_BASE );
#endif
2007-08-30 08:15:05 +00:00
return msg;
}
2010-08-28 20:02:24 +02:00
int KeyCodeFromKeyName( const wxString& keyname )
{
int ii, keycode = KEY_NON_FOUND;
2007-08-30 08:15:05 +00:00
2010-08-28 20:02:24 +02:00
// Search for modifiers: Ctrl+ Alt+ and Shift+
// Note: on Mac OSX, the Cmd key is equiv here to Ctrl
2010-08-28 20:02:24 +02:00
wxString key = keyname;
wxString prefix;
2010-08-28 20:02:24 +02:00
int modifier = 0;
2019-06-09 22:57:23 +01:00
while( true )
2010-08-28 20:02:24 +02:00
{
prefix.Empty();
if( key.StartsWith( MODIFIER_CTRL_BASE ) )
{
2019-06-09 22:57:23 +01:00
modifier |= MD_CTRL;
prefix = MODIFIER_CTRL_BASE;
}
else if( key.StartsWith( MODIFIER_CMD_MAC ) )
2010-08-28 20:02:24 +02:00
{
2019-06-09 22:57:23 +01:00
modifier |= MD_CTRL;
prefix = MODIFIER_CMD_MAC;
2010-08-28 20:02:24 +02:00
}
2010-08-28 21:08:58 +02:00
else if( key.StartsWith( MODIFIER_ALT ) )
2010-08-28 20:02:24 +02:00
{
2019-06-09 22:57:23 +01:00
modifier |= MD_ALT;
prefix = MODIFIER_ALT;
2010-08-28 20:02:24 +02:00
}
2010-08-28 21:08:58 +02:00
else if( key.StartsWith( MODIFIER_SHIFT ) )
2010-08-28 20:02:24 +02:00
{
2019-06-09 22:57:23 +01:00
modifier |= MD_SHIFT;
prefix = MODIFIER_SHIFT;
2010-08-28 20:02:24 +02:00
}
else
{
2010-08-28 20:02:24 +02:00
break;
}
if( !prefix.IsEmpty() )
key.Remove( 0, prefix.Len() );
2010-08-28 20:02:24 +02:00
}
2010-08-29 18:36:52 +02:00
if( (key.length() == 1) && (key[0] > ' ') && (key[0] < 0x7F) )
2010-08-28 20:02:24 +02:00
{
keycode = key[0];
keycode += modifier;
2010-08-29 18:36:52 +02:00
return keycode;
2010-08-28 20:02:24 +02:00
}
for( ii = 0; hotkeyNameList[ii].m_KeyCode != KEY_NON_FOUND; ii++ )
2007-08-30 08:15:05 +00:00
{
if( key.CmpNoCase( hotkeyNameList[ii].m_Name ) == 0 )
2007-08-30 08:15:05 +00:00
{
keycode = hotkeyNameList[ii].m_KeyCode + modifier;
2007-08-30 08:15:05 +00:00
break;
}
}
return keycode;
2007-08-20 11:33:45 +00:00
}
2007-08-30 08:15:05 +00:00
2021-08-30 00:33:08 +01:00
void DisplayHotkeyList( EDA_BASE_FRAME* aParent )
2007-08-20 11:33:45 +00:00
{
2021-08-30 00:33:08 +01:00
DIALOG_LIST_HOTKEYS dlg( aParent );
dlg.ShowModal();
2007-08-20 11:33:45 +00:00
}
2007-08-30 08:15:05 +00:00
2023-07-13 10:08:00 -04:00
void ReadHotKeyConfig( const wxString& aFileName,
std::map<std::string, std::pair<int, int>>& aHotKeys )
2007-08-20 11:33:45 +00:00
{
2020-12-19 11:00:52 -05:00
wxString fileName = aFileName;
if( fileName.IsEmpty() )
{
2023-01-16 19:07:41 -05:00
wxFileName fn( wxS( "user" ) );
fn.SetExt( FILEEXT::HotkeyFileExtension );
fn.SetPath( PATHS::GetUserSettingsPath() );
fileName = fn.GetFullPath();
}
2020-10-02 18:31:19 +02:00
if( !wxFile::Exists( fileName ) )
return;
2020-12-12 13:11:51 -05:00
wxFFile file( fileName, "rb" );
2019-06-09 22:57:23 +01:00
if( !file.IsOpened() ) // There is a problem to open file
return;
2007-08-30 08:15:05 +00:00
wxString input;
2019-06-09 22:57:23 +01:00
file.ReadAll( &input );
input.Replace( "\r\n", "\n" ); // Convert Windows files to Unix line-ends
2023-01-16 19:07:41 -05:00
wxStringTokenizer fileTokenizer( input, wxS( "\n" ), wxTOKEN_STRTOK );
2019-06-09 22:57:23 +01:00
while( fileTokenizer.HasMoreTokens() )
2007-08-30 08:15:05 +00:00
{
2023-01-16 19:07:41 -05:00
wxStringTokenizer lineTokenizer( fileTokenizer.GetNextToken(), wxS( "\t" ) );
2023-07-13 10:08:00 -04:00
wxString cmdName = lineTokenizer.GetNextToken();
wxString primary = lineTokenizer.GetNextToken();
wxString secondary = lineTokenizer.GetNextToken();
2010-08-28 20:02:24 +02:00
2019-06-09 22:57:23 +01:00
if( !cmdName.IsEmpty() )
2023-07-13 10:08:00 -04:00
aHotKeys[cmdName.ToStdString()] = std::pair<int, int>(
KeyCodeFromKeyName( primary ), KeyCodeFromKeyName( secondary ) );
2007-08-30 08:15:05 +00:00
}
}
void ReadHotKeyConfigIntoActions( const wxString& aFileName, std::vector<TOOL_ACTION*>& aActions )
{
2023-07-13 10:08:00 -04:00
std::map<std::string, std::pair<int, int>> hotkeys;
// Read the existing config (all hotkeys)
ReadHotKeyConfig( aFileName, hotkeys );
// Set each tool action hotkey to the config file hotkey if present
for( TOOL_ACTION* action : aActions )
2025-01-13 13:05:29 -05:00
{
if( hotkeys.find( action->GetName() ) != hotkeys.end() )
2023-07-13 10:08:00 -04:00
{
std::pair<int, int> keys = hotkeys[action->GetName()];
action->SetHotKey( keys.first, keys.second );
}
2025-01-13 13:05:29 -05:00
}
}
2021-08-30 00:33:08 +01:00
int WriteHotKeyConfig( const std::vector<TOOL_ACTION*>& aActions )
{
2023-07-13 10:08:00 -04:00
std::map<std::string, std::pair<int, int>> hotkeys;
wxFileName fn( "user" );
fn.SetExt( FILEEXT::HotkeyFileExtension );
fn.SetPath( PATHS::GetUserSettingsPath() );
2007-08-30 08:15:05 +00:00
// Read the existing config (all hotkeys)
ReadHotKeyConfig( fn.GetFullPath(), hotkeys );
2020-10-02 18:31:19 +02:00
// Overlay the current app's hotkey definitions onto the map
2021-08-30 00:33:08 +01:00
for( const TOOL_ACTION* action : aActions )
2025-01-13 13:05:29 -05:00
hotkeys[ action->GetName() ] = std::pair<int, int>( action->GetHotKey(),
action->GetHotKeyAlt() );
2019-06-09 22:57:23 +01:00
// Write entire hotkey set
2020-12-12 09:50:52 -05:00
wxFFileOutputStream outStream( fn.GetFullPath() );
wxTextOutputStream txtStream( outStream, wxEOL_UNIX );
2020-10-02 18:31:19 +02:00
2023-07-13 10:08:00 -04:00
for( const std::pair<const std::string, std::pair<int, int>>& entry : hotkeys )
txtStream << entry.first
<< "\t" << KeyNameFromKeyCode( entry.second.first )
<< "\t" << KeyNameFromKeyCode( entry.second.second ) << endl;
2020-12-12 09:50:52 -05:00
txtStream.Flush();
outStream.Close();
2019-06-09 22:57:23 +01:00
return 1;
}
2019-06-09 22:57:23 +01:00
int ReadLegacyHotkeyConfig( const wxString& aAppname, std::map<std::string, int>& aMap )
{
// For Eeschema and Pcbnew frames, we read the new combined file.
// For other kifaces, we read the frame-based file
if( aAppname == LIB_EDIT_FRAME_NAME || aAppname == SCH_EDIT_FRAME_NAME )
2018-02-23 08:44:29 -08:00
{
2019-06-09 22:57:23 +01:00
return ReadLegacyHotkeyConfigFile( EESCHEMA_HOTKEY_NAME, aMap );
2010-08-28 20:02:24 +02:00
}
2019-06-09 22:57:23 +01:00
else if( aAppname == PCB_EDIT_FRAME_NAME || aAppname == FOOTPRINT_EDIT_FRAME_NAME )
2010-08-28 20:02:24 +02:00
{
2019-06-09 22:57:23 +01:00
return ReadLegacyHotkeyConfigFile( PCBNEW_HOTKEY_NAME, aMap );
2010-08-28 20:02:24 +02:00
}
2019-06-09 22:57:23 +01:00
return ReadLegacyHotkeyConfigFile( aAppname, aMap );
}
2019-06-09 22:57:23 +01:00
int ReadLegacyHotkeyConfigFile( const wxString& aFilename, std::map<std::string, int>& aMap )
{
wxFileName fn( aFilename );
fn.SetExt( FILEEXT::HotkeyFileExtension );
fn.SetPath( PATHS::GetUserSettingsPath() );
2018-02-23 08:44:29 -08:00
if( !wxFile::Exists( fn.GetFullPath() ) )
return 0;
2007-08-30 08:15:05 +00:00
2020-12-12 13:11:51 -05:00
wxFFile cfgfile( fn.GetFullPath(), "rb" );
2020-10-02 18:31:19 +02:00
if( !cfgfile.IsOpened() ) // There is a problem to open file
return 0;
// get length
2020-12-12 13:11:51 -05:00
wxFileOffset size = cfgfile.Length();
2010-08-28 20:02:24 +02:00
// read data
2018-01-08 12:52:17 +01:00
std::vector<char> buffer( size );
2018-01-06 04:22:00 +00:00
cfgfile.Read( buffer.data(), size );
wxString data( buffer.data(), wxConvUTF8, size );
2007-08-30 08:15:05 +00:00
2018-02-23 08:44:29 -08:00
// Is this the wxConfig format? If so, remove "Keys=" and parse the newlines.
if( data.StartsWith( wxT("Keys="), &data ) )
data.Replace( "\\n", "\n", true );
// parse
2010-08-28 20:02:24 +02:00
wxStringTokenizer tokenizer( data, L"\r\n", wxTOKEN_STRTOK );
while( tokenizer.HasMoreTokens() )
{
2010-08-28 20:02:24 +02:00
wxString line = tokenizer.GetNextToken();
wxStringTokenizer lineTokenizer( line );
wxString line_type = lineTokenizer.GetNextToken();
2011-09-29 12:49:40 -04:00
2019-06-09 22:57:23 +01:00
if( line_type[0] == '#' ) // comment
2010-08-28 20:02:24 +02:00
continue;
2019-06-09 22:57:23 +01:00
if( line_type[0] == '[' ) // tags ignored reading legacy hotkeys
continue;
2018-02-23 09:22:56 -08:00
2010-08-28 20:02:24 +02:00
if( line_type == wxT( "$Endlist" ) )
2007-08-30 08:15:05 +00:00
break;
2010-08-28 20:02:24 +02:00
if( line_type != wxT( "shortcut" ) )
continue;
// Get the key name
2010-08-28 20:02:24 +02:00
lineTokenizer.SetString( lineTokenizer.GetString(), L"\"\r\n\t ", wxTOKEN_STRTOK );
wxString keyname = lineTokenizer.GetNextToken();
2010-08-28 20:02:24 +02:00
wxString remainder = lineTokenizer.GetString();
// Get the command name
2010-08-28 20:02:24 +02:00
wxString fctname = remainder.AfterFirst( '\"' ).BeforeFirst( '\"' );
2019-06-09 22:57:23 +01:00
// Add the pair to the map
aMap[ fctname.ToStdString() ] = KeyCodeFromKeyName( keyname );
2007-08-30 08:15:05 +00:00
}
2019-06-09 22:57:23 +01:00
// cleanup
cfgfile.Close();
return 1;
}
2007-09-19 15:29:50 +00:00