OSDN Git Service

[UI][OSD][Qt][CONFIG] Add option: Emulate cursor keys as "2468" or "1235".
authorK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 9 Feb 2018 08:51:21 +0000 (17:51 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 9 Feb 2018 08:51:21 +0000 (17:51 +0900)
[CONFIG][Qt] Remove "roma_cana_conversion".Cause of merging romaji-kana conversion feature to upstream.

14 files changed:
source/src/config.cpp
source/src/config.h
source/src/qt/CMakeLists.txt
source/src/qt/common/emu_thread.cpp
source/src/qt/common/menu_flags.cpp
source/src/qt/gui/CMakeLists.txt
source/src/qt/gui/commonclasses.h
source/src/qt/gui/emu_thread_tmpl.cpp
source/src/qt/gui/emu_thread_tmpl.h
source/src/qt/gui/mainwidget_base.h
source/src/qt/gui/menu_flags.h
source/src/qt/gui/menu_flags_tmpl.cpp
source/src/qt/gui/menu_main.cpp
source/src/qt/osd_input.cpp

index 109566b..8b47c54 100644 (file)
@@ -196,12 +196,20 @@ void initialize_config()
                        }
                }
                
-               config.roma_kana_conversion = false;
                config.rendering_type = CONFIG_RENDER_TYPE_STD;
                config.virtual_media_position = 2; // Down.
                for(int drv = 0; drv < 16; drv++) {
                        config.disk_count_immediate[drv] = false;
                }
+               // Extra UI
+               config.cursor_as_ten_key = CONFIG_CURSOR_AS_CURSOR;
+       #if defined(_FM7) || defined(_FMNEW7) || defined(_FM8) \
+           || defined(_FM77_VARIANTS) || defined(_FM77AV_VARIANTS)             
+               config.enter_as_numpad_enter = false;
+       #else
+               config.enter_as_numpad_enter = true;
+       #endif
+               config.host_keyboard_type = CONFIG_HOST_KEYBOARD_AT_109JP;
 #endif 
 }
 
@@ -403,7 +411,6 @@ void load_config(const _TCHAR *config_path)
                config.opengl_scanline_horiz = MyGetPrivateProfileBool(_T("Qt"), _T("OpenGLScanLineHoriz"), config.opengl_scanline_horiz, config_path);;
                config.use_opengl_filters = MyGetPrivateProfileBool(_T("Qt"), _T("UseOpenGLFilters"), config.use_opengl_filters, config_path);
                config.opengl_filter_num = MyGetPrivateProfileInt(_T("Qt"), _T("OpenGLFilterNum"), config.opengl_filter_num, config_path);
-               config.swap_kanji_pause = MyGetPrivateProfileBool(_T("Qt"), _T("SwapKanjiPause"), config.swap_kanji_pause, config_path);
                config.render_platform = MyGetPrivateProfileInt(_T("Qt"), _T("RenderPlatform"), config.render_platform, config_path);
                config.render_major_version = MyGetPrivateProfileInt(_T("Qt"), _T("RenderMajorVersion"), config.render_major_version, config_path);
                config.render_minor_version = MyGetPrivateProfileInt(_T("Qt"), _T("RenderMinorVersion"), config.render_minor_version, config_path);
@@ -421,6 +428,13 @@ void load_config(const _TCHAR *config_path)
                        MyGetPrivateProfileString(_T("Qt"), (const _TCHAR *)name, _T(""),
                                                                          config.assigned_joystick_name[i], 256, config_path);
                }
+
+               // Extra UI
+               config.swap_kanji_pause = MyGetPrivateProfileBool(_T("Qt"), _T("SwapKanjiPause"), config.swap_kanji_pause, config_path);
+               config.cursor_as_ten_key = MyGetPrivateProfileInt(_T("Qt"), _T("CursorAsTenKey"), config.cursor_as_ten_key, config_path);
+               config.enter_as_numpad_enter = MyGetPrivateProfileBool(_T("Qt"), _T("EnterAsNumpadEnter"), config.enter_as_numpad_enter, config_path);
+               config.host_keyboard_type = MyWritePrivateProfileInt(_T("Qt"), _T("HostKeyboardType"), config.host_keyboard_type, config_path);
+
                
                // Movie load/save.
                config.video_width   = MyGetPrivateProfileInt(_T("Qt"), _T("VideoWidth"), config.video_width, config_path);
@@ -494,7 +508,6 @@ void load_config(const _TCHAR *config_path)
                // Logging
                config.log_to_syslog = MyGetPrivateProfileBool(_T("Qt"), _T("WriteToSyslog"), config.log_to_syslog, config_path);
                config.log_to_console = MyGetPrivateProfileBool(_T("Qt"), _T("WriteToConsole"), config.log_to_console, config_path);
-               config.roma_kana_conversion = MyGetPrivateProfileInt(_T("Qt"), _T("RomaKana"), config.roma_kana_conversion, config_path);
                
                for(int ii = 0; ii < (CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1) ; ii++) {
                        uint32_t flags = 0;
@@ -727,6 +740,12 @@ void save_config(const _TCHAR *config_path)
                MyWritePrivateProfileInt(_T("Qt"), _T("GeneralSoundLevel"), config.general_sound_level, config_path);
                MyWritePrivateProfileBool(_T("Qt"), _T("FocusWithClick"), config.focus_with_click, config_path);
 
+               // Extra UI
+               MyWritePrivateProfileBool(_T("Qt"), _T("SwapKanjiPause"), config.swap_kanji_pause, config_path);
+               MyWritePrivateProfileInt(_T("Qt"), _T("CursorAsTenKey"), config.cursor_as_ten_key, config_path);
+               MyWritePrivateProfileBool(_T("Qt"), _T("EnterAsNumpadEnter"), config.enter_as_numpad_enter, config_path);
+               MyWritePrivateProfileInt(_T("Qt"), _T("HostKeyboardType"), config.host_keyboard_type, config_path);
+
                for(i = 0; i < 16; i++) {
                        _TCHAR name[256];
                        my_stprintf_s(name, 256, _T("AssignedJoystick%d"), i + 1);
@@ -756,7 +775,6 @@ void save_config(const _TCHAR *config_path)
                
                MyWritePrivateProfileBool(_T("Qt"), _T("WriteToSyslog"), config.log_to_syslog, config_path);
                MyWritePrivateProfileBool(_T("Qt"), _T("WriteToConsole"), config.log_to_console, config_path);
-               MyWritePrivateProfileInt(_T("Qt"), _T("RomaKana"), config.roma_kana_conversion, config_path);
                
                for(int ii = 0; ii < (CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1) ; ii++) {
                        uint32_t flags = 0;
index d99d63e..af6344e 100644 (file)
@@ -37,6 +37,39 @@ enum {
        CONFIG_RENDER_PLATFORM_DIRECTX     = 32,
 };
 
+/*
+ * ToDo: Apply keyboard types for emulation.
+ */
+enum {
+       CONFIG_HOST_KEYBOARD_TYPE_AT_JP   = 0x00000000,
+       CONFIG_HOST_KEYBOARD_TYPE_AT_EN   = 0x00010000,
+       CONFIG_HOST_KEYBOARD_TYPE_AT_83   = 0x00030000,
+       CONFIG_HOST_KEYBOARD_TYPE_AT_84   = 0x00040000,
+       CONFIG_HOST_KEYBOARD_TYPE_AT_MISC = 0x00ff0000,
+       CONFIG_HOST_KEYBOARD_TYPE_PC98    = 0x00980000,
+       CONFIG_HOST_KEYBOARD_TYPE_MAC     = 0x00fe0000,
+};     
+
+enum {
+       CONFIG_HOST_KEYBOARD_AT_106JP    = CONFIG_HOST_KEYBOARD_TYPE_AT_JP + 106,
+       CONFIG_HOST_KEYBOARD_AT_101      = CONFIG_HOST_KEYBOARD_TYPE_AT_EN + 101,
+       CONFIG_HOST_KEYBOARD_AT_102      = CONFIG_HOST_KEYBOARD_TYPE_AT_EN + 102,
+       CONFIG_HOST_KEYBOARD_AT_104      = CONFIG_HOST_KEYBOARD_TYPE_AT_EN + 104,
+       CONFIG_HOST_KEYBOARD_AT_109JP    = CONFIG_HOST_KEYBOARD_TYPE_AT_JP + 109,
+       CONFIG_HOST_KEYBOARD_AT_83       = CONFIG_HOST_KEYBOARD_TYPE_AT_83 + 83,
+       CONFIG_HOST_KEYBOARD_AT_84       = CONFIG_HOST_KEYBOARD_TYPE_AT_84 + 84,
+       CONFIG_HOST_KEYBOARD_AT_MISC     = CONFIG_HOST_KEYBOARD_TYPE_AT_MISC,
+       CONFIG_HOST_KEYBOARD_MAC_US      = CONFIG_HOST_KEYBOARD_TYPE_MAC + 0,
+       CONFIG_HOST_KEYBOARD_MAC_JP      = CONFIG_HOST_KEYBOARD_TYPE_MAC + 1,
+       CONFIG_HOST_KEYBOARD_MAC_ANOTHER = CONFIG_HOST_KEYBOARD_TYPE_MAC + 0xff,
+};     
+
+enum {
+       CONFIG_CURSOR_AS_CURSOR = 0,
+       CONFIG_CURSOR_AS_2468 = 1,
+       CONFIG_CURSOR_AS_1235 = 2,
+};
+
 #define MAX_HISTORY    8
 
 #ifdef USE_FIXED_CONFIG
@@ -182,6 +215,11 @@ typedef struct {
        
        
        bool swap_kanji_pause;
+       int  cursor_as_ten_key;
+       bool enter_as_numpad_enter;
+       
+       int host_keyboard_type;
+       
        /*
         * TYPE : 
         *    0 : OpenGL/Main Profile
@@ -267,7 +305,6 @@ typedef struct {
        bool dev_log_to_console[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
        bool dev_log_recording[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
 
-       bool roma_kana_conversion;
        int rendering_type;
 
        int virtual_media_position; // -1 = none, 1, 2, 3, 4 = LRUD
index 2075abc..dadc216 100644 (file)
@@ -1,5 +1,5 @@
 message("* qt/osd")
-SET(THIS_LIB_VERSION 2.9.15
+SET(THIS_LIB_VERSION 2.9.16
 
 set(s_qt_osd_headers
        osd_base.h
index b37eb1a..863da65 100644 (file)
@@ -45,10 +45,9 @@ EmuThreadClass::~EmuThreadClass()
 
 void EmuThreadClass::set_romakana(void)
 {
-       romakana_conversion_mode = !romakana_conversion_mode;
        p_config->romaji_to_kana = !p_config->romaji_to_kana;
 #if defined(USE_AUTO_KEY)
-       p_emu->set_auto_key_char(romakana_conversion_mode ? 1 : 0);
+       p_emu->set_auto_key_char(p_config->romaji_to_kana ? 1 : 0);
 #endif
 }
 
@@ -588,7 +587,7 @@ void EmuThreadClass::print_framerate(int frames)
                                                snprintf(buf, 255, _T("%s - %d fps (%d %%)"), DEVICE_NAME, draw_frames, ratio);
                                        }
                                }
-                               if(romakana_conversion_mode) {
+                               if(p_config->romaji_to_kana) {
                                        message = QString::fromUtf8("[R]");
                                        message = message + QString::fromUtf8(buf);
                                } else {
index 00fc902..84a7f9e 100644 (file)
@@ -28,7 +28,6 @@ USING_FLAGS_EXT::USING_FLAGS_EXT(config_t *cfg) : USING_FLAGS(cfg)
        use_auto_key = use_auto_key_us = use_auto_key_caps = false;
        use_auto_key_no_caps = use_auto_key_release =
        use_auto_key_shift = use_binary_file = false;
-       use_roma_kana_conversion = false;
        
        max_binary = 0;
        use_bitmap = false;
@@ -230,9 +229,6 @@ USING_FLAGS_EXT::USING_FLAGS_EXT(config_t *cfg) : USING_FLAGS(cfg)
                use_auto_key_shift = true;
        #endif
 #endif
-#if defined(SUPPORT_ROMA_KANA_CONVERSION)
-       use_roma_kana_conversion = true;
-#endif
 #if defined(USE_BINARY_FILE1) || defined(USE_BINARY_FILE2) || defined(USE_BINARY_FILE3) || defined(USE_BINARY_FILE4) || \
        defined(USE_BINARY_FILE5) || defined(USE_BINARY_FILE6) || defined(USE_BINARY_FILE7) || defined(USE_BINARY_FILE8)
        use_binary_file = true;
index 299009b..7d04646 100644 (file)
@@ -1,6 +1,6 @@
 message("* qt/gui")
 
-set(THIS_LIB_VERSION 2.10.8)
+set(THIS_LIB_VERSION 2.10.9)
 set(s_qt_gui_headers
          csp_logger.h
   
index 0b8d3c9..e9a2071 100644 (file)
@@ -213,6 +213,7 @@ public slots:
        void do_save_state(void);
        void do_load_state(void);
        void do_set_window_focus_type(bool flag);
+       void do_set_emulate_cursor_as(void);
        
 signals:
        int quit_emu_thread(void);
@@ -223,6 +224,7 @@ signals:
        int sig_save_state(QString);
        int sig_load_state(QString);
        int sig_set_window_focus_type(bool);
+       void sig_set_emulate_cursor_as(int);
 } ActionControl;
 QT_END_NAMESPACE
 
index 7e4f70b..f1bc74f 100644 (file)
@@ -192,12 +192,6 @@ void EmuThreadClassBase::do_key_down(uint32_t vk, uint32_t mod, bool repeat)
        sp.mod = mod;
        sp.repeat = repeat;
        //key_changed = true;
-       if(using_flags->is_use_roma_kana_conversion()) {
-               if(vk == VK_F12) {
-                       set_romakana();
-                       return;
-               }
-       }
        enqueue_key_down(sp);
        key_mod = mod;
 }
index e0ed313..3e2583e 100644 (file)
@@ -63,7 +63,6 @@ protected:
 
        
        uint32_t key_mod;
-       bool romakana_conversion_mode;
 
        EMU *p_emu;
        USING_FLAGS *using_flags;
index 88212f1..01c35ab 100644 (file)
@@ -203,6 +203,10 @@ private:
        class Action_Control *action_SetupKeyboard;
        class Action_Control *action_LogView;
 
+       QMenu *menu_EmulateCursorAs;
+       QActionGroup *actionGroup_EmulateCursorAs;
+       class Action_Control *action_EmulateCursorAs[4];
+
        // Help
        class Action_Control *actionHelp_README_BIOS;
        class Action_Control *actionHelp_README;
@@ -632,6 +636,9 @@ public slots:
        void do_set_visible_virtual_media_lower();
        void do_set_visible_virtual_media_left();
        void do_set_visible_virtual_media_right();
+
+       void do_set_emulate_cursor_as(int num);
+       
 signals:
        int message_changed(QString);
        int quit_emu_thread();
index ef2f5f5..892f8cd 100644 (file)
@@ -31,7 +31,6 @@ protected:
        QString device_name;
        // USE_* flags
        bool use_alt_f10_key;
-       bool use_roma_kana_conversion;
        
        bool use_auto_key;
        bool use_auto_key_us;
@@ -184,7 +183,6 @@ public:
        bool is_use_auto_key_no_caps() { return use_auto_key_no_caps; }
        bool is_use_auto_key_release() { return use_auto_key_release; }
        bool is_use_auto_key_shift() { return use_auto_key_shift; }
-       bool is_use_roma_kana_conversion() { return use_roma_kana_conversion; }
 
        bool is_use_binary_file() { return use_binary_file; }
        int get_max_binary() { return max_binary; }
index a45420b..5a2e850 100644 (file)
@@ -9,7 +9,6 @@ USING_FLAGS::USING_FLAGS(config_t *cfg)
        use_auto_key = use_auto_key_us = use_auto_key_caps = false;
        use_auto_key_no_caps = use_auto_key_release =
        use_auto_key_shift = use_binary_file = false;
-       use_roma_kana_conversion = false;
        
        max_binary = 0;
        use_bitmap = false;
index 9695f83..d2fae99 100644 (file)
@@ -105,6 +105,12 @@ void Action_Control::do_set_window_focus_type(bool f)
        emit sig_set_window_focus_type(f);
 }
 
+void Action_Control::do_set_emulate_cursor_as(void)
+{
+       int num = this->binds->getValue1();
+       emit sig_set_emulate_cursor_as(num);
+}
+
 void Action_Control::do_set_dev_log_to_console(bool f)
 {
        int num = this->binds->getValue1();
@@ -117,10 +123,6 @@ void Action_Control::do_set_dev_log_to_syslog(bool f)
        emit sig_set_dev_log_to_syslog(num, f);
 }
 
-void Ui_MainWindowBase::do_set_roma_kana(bool flag)
-{
-       using_flags->get_config_ptr()->roma_kana_conversion = flag;
-}
 
 void Ui_MainWindowBase::do_set_window_focus_type(bool flag)
 {
@@ -212,6 +214,13 @@ void Ui_MainWindowBase::do_set_dev_log_to_console(int num, bool f)
        using_flags->get_config_ptr()->dev_log_to_console[num][0] = f;
 }
 
+void Ui_MainWindowBase::do_set_emulate_cursor_as(int num)
+{
+       if((num < 0) || (num > 2)) return;
+       using_flags->get_config_ptr()->cursor_as_ten_key = num;
+       emit sig_emu_update_config();
+}
+
 void Ui_MainWindowBase::do_set_dev_log_to_syslog(int num, bool f)
 {
        csp_logger->set_device_node_log(num, 2, CSP_LOG_DEBUG, f);
@@ -719,11 +728,20 @@ void Ui_MainWindowBase::retranslateEmulatorMenu(void)
                action_SetupJoystick->setToolTip(QApplication::translate("MainWindow", "Configure assigning buttons/directions of joysticks.", 0));
                action_SetupJoystick->setIcon(QIcon(":/icon_gamepad.png"));
        }
-       if(using_flags->is_use_roma_kana_conversion()) {
+       if(using_flags->is_use_auto_key()) {
                action_UseRomaKana->setText(QApplication::translate("MainWindow", "ROMA-KANA Conversion", 0));
                action_UseRomaKana->setToolTip(QApplication::translate("MainWindow", "Use romaji-kana conversion assistant of emulator.", 0));
        }
+       // ToDo
+       menu_EmulateCursorAs->setTitle(QApplication::translate("MainWindow", "Emulate cursor as", 0));
+       menu_EmulateCursorAs->setToolTip(QApplication::translate("MainWindow", "Emulate cursor as ten-key.", 0));
+       action_EmulateCursorAs[0]->setText(QApplication::translate("MainWindow", "None", 0));
+       action_EmulateCursorAs[1]->setText(QApplication::translate("MainWindow", "2 4 6 8", 0));
+       action_EmulateCursorAs[2]->setText(QApplication::translate("MainWindow", "1 2 3 5", 0));
+       
        menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0));
+
+       
        action_FocusWithClick->setText(QApplication::translate("MainWindow", "Focus on click", 0));
        action_FocusWithClick->setToolTip(QApplication::translate("MainWindow", "If set, focus with click, not mouse-over.", 0));
        
@@ -779,16 +797,22 @@ void Ui_MainWindowBase::retranselateUi_Depended_OSD(void)
        }
 }
 
+void Ui_MainWindowBase::do_set_roma_kana(bool flag)
+{
+       using_flags->get_config_ptr()->romaji_to_kana = flag;
+}
+
 void Ui_MainWindowBase::CreateEmulatorMenu(void)
 {
        //menuEmulator->addAction(action_LogRecord);
        menuEmulator->addAction(action_FocusWithClick);
        menuEmulator->addAction(menu_DispVirtualMedias->menuAction());
        menuEmulator->addSeparator();
-       if(using_flags->is_use_roma_kana_conversion()) {
+       if(using_flags->is_use_auto_key()) {
                menuEmulator->addAction(action_UseRomaKana);
-               menuEmulator->addSeparator();
        }
+       menuEmulator->addAction(menu_EmulateCursorAs->menuAction());
+       menuEmulator->addSeparator();
        menuEmulator->addAction(action_LogToConsole);
        menuEmulator->addAction(menuDevLogToConsole->menuAction());
        menuEmulator->addSeparator();
@@ -833,18 +857,35 @@ void Ui_MainWindowBase::ConfigEmulatorMenu(void)
        connect(action_DispVirtualMedias[0], SIGNAL(triggered()), this, SLOT(do_set_visible_virtual_media_none()));
        connect(action_DispVirtualMedias[1], SIGNAL(triggered()), this, SLOT(do_set_visible_virtual_media_upper()));
        connect(action_DispVirtualMedias[2], SIGNAL(triggered()), this, SLOT(do_set_visible_virtual_media_lower()));
-       //connect(action_DispVirtualMedias[3], SIGNAL(triggered()), this, SLOT(do_set_visible_virtual_media_left()));
-       //connect(action_DispVirtualMedias[4], SIGNAL(triggered()), this, SLOT(do_set_visible_virtual_media_right()));
                        
-       //SET_ACTION_SINGLE(action_DispVirtualMedias, true, true, (using_flags->get_config_ptr()->sound_noise_cmt != 0));
-       
-       if(using_flags->is_use_roma_kana_conversion()) {
-               //action_UseRomaKana = new Action_Control(this, using_flags);
-               //action_UseRomaKana->setCheckable(true);
-               //if(using_flags->get_config_ptr()->roma_kana_conversion) action_UseRomaKana->setChecked(true);
-               SET_ACTION_SINGLE(action_UseRomaKana, true, true, (using_flags->get_config_ptr()->roma_kana_conversion));
+       if(using_flags->is_use_auto_key()) {
+               SET_ACTION_SINGLE(action_UseRomaKana, true, true, (using_flags->get_config_ptr()->romaji_to_kana));
                connect(action_UseRomaKana, SIGNAL(toggled(bool)), this, SLOT(do_set_roma_kana(bool)));
        }
+       // Cursor to ten key.
+       
+       menu_EmulateCursorAs = new QMenu(this);
+       menu_EmulateCursorAs->setToolTipsVisible(true);
+       actionGroup_EmulateCursorAs = new QActionGroup(this);
+       actionGroup_EmulateCursorAs->setExclusive(true);
+       {
+               for(i = 0; i < 3; i++) {
+                       tmps = QString::number(i);
+                       action_EmulateCursorAs[i] = new Action_Control(this, using_flags);
+                       action_EmulateCursorAs[i]->setObjectName(QString::fromUtf8("action_EmulateCursorAs", -1) + tmps);
+                       action_EmulateCursorAs[i]->setCheckable(true);
+                       action_EmulateCursorAs[i]->binds->setValue1(i);
+                       actionGroup_EmulateCursorAs->addAction(action_EmulateCursorAs[i]);
+                       menu_EmulateCursorAs->addAction(action_EmulateCursorAs[i]);
+                       if(i == using_flags->get_config_ptr()->cursor_as_ten_key) action_EmulateCursorAs[i]->setChecked(true);
+                               
+                       connect(action_EmulateCursorAs[i], SIGNAL(triggered()),
+                                       action_EmulateCursorAs[i], SLOT(do_set_emulate_cursor_as()));
+                       connect(action_EmulateCursorAs[i], SIGNAL(sig_set_emulate_cursor_as(int)),
+                                       this, SLOT(do_set_emulate_cursor_as(int)));
+               }
+       }
+       
        if(using_flags->is_use_joystick()) {
                action_SetupJoystick = new Action_Control(this, using_flags);
        }
index 0f79c26..ca06d0c 100644 (file)
@@ -208,7 +208,36 @@ void OSD_BASE::key_down(int code, bool extended, bool repeat)
                                        return;
                                }
                        }
-                  
+
+                       switch(p_config->cursor_as_ten_key) {
+                       case CONFIG_CURSOR_AS_2468:
+                               if(code == VK_RIGHT) {
+                                       code = VK_NUMPAD6;
+                               } else if(code == VK_LEFT) {
+                                       code = VK_NUMPAD4;
+                               } else if(code == VK_DOWN) {
+                                       code = VK_NUMPAD2;
+                               } else if(code == VK_UP) {
+                                       code = VK_NUMPAD8;
+                               }
+                               break;
+                       case CONFIG_CURSOR_AS_1235:
+                               if(code == VK_RIGHT) {
+                                       code = VK_NUMPAD3;
+                               } else if(code == VK_LEFT) {
+                                       code = VK_NUMPAD1;
+                               } else if(code == VK_DOWN) {
+                                       code = VK_NUMPAD2;
+                               } else if(code == VK_UP) {
+                                       code = VK_NUMPAD5;
+                               }
+                               break;
+                       case CONFIG_CURSOR_AS_CURSOR:
+                               break;
+                       default:
+                               break;
+                       }
+   
 //#ifdef USE_SHIFT_NUMPAD_KEY
                        if(__USE_SHIFT_NUMPAD_KEY) {
 //                     if(code == VK_LSHIFT || code == VK_RSHIFT) {
@@ -292,46 +321,6 @@ void OSD_BASE::key_down(int code, bool extended, bool repeat)
 //#ifdef USE_AUTO_KEY
        }
 //#endif
-#if 0
-       if(code == VK_SHIFT) {
-               if(!(key_status[VK_LSHIFT] & 0x80) && (GetAsyncKeyState(VK_LSHIFT) & 0x8000)) {
-                       code = VK_LSHIFT;
-               } else if(!(key_status[VK_RSHIFT] & 0x80) && (GetAsyncKeyState(VK_RSHIFT) & 0x8000)) {
-                       code = VK_RSHIFT;
-               } else {
-                       return;
-               }
-       } else if(code == VK_CONTROL) {
-               if(!(key_status[VK_LCONTROL] & 0x80) && (GetAsyncKeyState(VK_LCONTROL) & 0x8000)) {
-                       code = VK_LCONTROL;
-               } else if(!(key_status[VK_RCONTROL] & 0x80) && (GetAsyncKeyState(VK_RCONTROL) & 0x8000)) {
-                       code = VK_RCONTROL;
-               } else {
-                       return;
-               }
-       } else if(code == VK_MENU) {
-               if(!(key_status[VK_LMENU] & 0x80) && (GetAsyncKeyState(VK_LMENU) & 0x8000)) {
-                       code = VK_LMENU;
-               } else if(!(key_status[VK_RMENU] & 0x80) && (GetAsyncKeyState(VK_RMENU) & 0x8000)) {
-                       code = VK_RMENU;
-               } else {
-                       return;
-               }
-       }
-       if(get_use_shift_numpad_key()) {
-               if(code == VK_LSHIFT) {
-                       key_shift_pressed = true;
-                       return;
-               } else if(numpad_table[code] != 0) {
-                       if(key_shift_pressed || key_shift_released) {
-                               key_converted[code] = 1;
-                               key_shift_pressed = true;
-                               code = numpad_table[code];
-                       }
-               }
-       }
-       key_down_native(code, repeat);
-#endif
 }
 
 void OSD_BASE::key_up(int code, bool extended)
@@ -366,59 +355,88 @@ void OSD_BASE::key_up(int code, bool extended)
                                        return;
                                }
                        }
+                       switch(p_config->cursor_as_ten_key) {
+                       case CONFIG_CURSOR_AS_2468:
+                               if(code == VK_RIGHT) {
+                                       code = VK_NUMPAD6;
+                               } else if(code == VK_LEFT) {
+                                       code = VK_NUMPAD4;
+                               } else if(code == VK_DOWN) {
+                                       code = VK_NUMPAD2;
+                               } else if(code == VK_UP) {
+                                       code = VK_NUMPAD8;
+                               }
+                               break;
+                       case CONFIG_CURSOR_AS_1235:
+                               if(code == VK_RIGHT) {
+                                       code = VK_NUMPAD3;
+                               } else if(code == VK_LEFT) {
+                                       code = VK_NUMPAD1;
+                               } else if(code == VK_DOWN) {
+                                       code = VK_NUMPAD2;
+                               } else if(code == VK_UP) {
+                                       code = VK_NUMPAD5;
+                               }
+                               break;
+                       case CONFIG_CURSOR_AS_CURSOR:
+                               break;
+                       default:
+                               break;
+                       }
 //#ifdef USE_SHIFT_NUMPAD_KEY
                        if(__USE_SHIFT_NUMPAD_KEY) {
                        
 //                     if(code == VK_LSHIFT || code == VK_RSHIFT) {
-                       if(code == VK_LSHIFT) {
-                               key_shift_pressed = false;
-                               key_shift_released = true;
-                               return;
-                       }
-                       if(!extended) {
-                               switch(code) {
-                               case VK_NUMPAD0: case VK_INSERT:
-                                       key_up_native(VK_NUMPAD0);
-                                       key_up_native(VK_INSERT);
-                                       return;
-                               case VK_NUMPAD1: case VK_END:
-                                       key_up_native(VK_NUMPAD1);
-                                       key_up_native(VK_END);
-                                       return;
-                               case VK_NUMPAD2: case VK_DOWN:
-                                       key_up_native(VK_NUMPAD2);
-                                       key_up_native(VK_DOWN);
-                                       return;
-                               case VK_NUMPAD3: case VK_NEXT:
-                                       key_up_native(VK_NUMPAD3);
-                                       key_up_native(VK_NEXT);
-                                       return;
-                               case VK_NUMPAD4: case VK_LEFT:
-                                       key_up_native(VK_NUMPAD4);
-                                       key_up_native(VK_LEFT);
-                                       return;
-                               case VK_NUMPAD5: case VK_CLEAR:
-                                       key_up_native(VK_NUMPAD5);
-                                       key_up_native(VK_CLEAR);
-                                       return;
-                               case VK_NUMPAD6: case VK_RIGHT:
-                                       key_up_native(VK_NUMPAD6);
-                                       key_up_native(VK_RIGHT);
-                                       return;
-                               case VK_NUMPAD7: case VK_HOME:
-                                       key_up_native(VK_NUMPAD7);
-                                       key_up_native(VK_HOME);
-                                       return;
-                               case VK_NUMPAD8: case VK_UP:
-                                       key_up_native(VK_NUMPAD8);
-                                       key_up_native(VK_UP);
-                                       return;
-                               case VK_NUMPAD9: case VK_PRIOR:
-                                       key_up_native(VK_NUMPAD9);
-                                       key_up_native(VK_PRIOR);
+                               if(code == VK_LSHIFT) {
+                                       key_shift_pressed = false;
+                                       key_shift_released = true;
                                        return;
                                }
-                       }
+
+                               if(!extended) {
+                                       switch(code) {
+                                       case VK_NUMPAD0: case VK_INSERT:
+                                               key_up_native(VK_NUMPAD0);
+                                               key_up_native(VK_INSERT);
+                                               return;
+                                       case VK_NUMPAD1: case VK_END:
+                                               key_up_native(VK_NUMPAD1);
+                                               key_up_native(VK_END);
+                                               return;
+                                       case VK_NUMPAD2: case VK_DOWN:
+                                               key_up_native(VK_NUMPAD2);
+                                               key_up_native(VK_DOWN);
+                                               return;
+                                       case VK_NUMPAD3: case VK_NEXT:
+                                               key_up_native(VK_NUMPAD3);
+                                               key_up_native(VK_NEXT);
+                                               return;
+                                       case VK_NUMPAD4: case VK_LEFT:
+                                               key_up_native(VK_NUMPAD4);
+                                               key_up_native(VK_LEFT);
+                                               return;
+                                       case VK_NUMPAD5: case VK_CLEAR:
+                                               key_up_native(VK_NUMPAD5);
+                                               key_up_native(VK_CLEAR);
+                                               return;
+                                       case VK_NUMPAD6: case VK_RIGHT:
+                                               key_up_native(VK_NUMPAD6);
+                                               key_up_native(VK_RIGHT);
+                                               return;
+                                       case VK_NUMPAD7: case VK_HOME:
+                                               key_up_native(VK_NUMPAD7);
+                                               key_up_native(VK_HOME);
+                                               return;
+                                       case VK_NUMPAD8: case VK_UP:
+                                               key_up_native(VK_NUMPAD8);
+                                               key_up_native(VK_UP);
+                                               return;
+                                       case VK_NUMPAD9: case VK_PRIOR:
+                                               key_up_native(VK_NUMPAD9);
+                                               key_up_native(VK_PRIOR);
+                                               return;
+                                       }
+                               }
                        }
 //#endif
                        key_up_native(code);