add_definitions(-DQT_MINOR_VERSION=${Qt5Widgets_VERSION_MINOR})
# Build Flags
-#find_package(Gettext)
-#include_directories(${GETTEXT_INCLUDE_PATH})
-#include(compile_gettext_catalogue)
-#if(GETTEXT_FOUND)
-# add_definitions(-DUSE_GETTEXT)
-#endif()
-
-
-#find_package(Freetype)
-#include_directories(${FREETYPE_INCLUDE_PATH})
-
-#find_package(Iconv)
-#if(ICONV_FOUND)
-# add_definitions(-DUSE_ICONV)
-#endif()
-
if(USE_OPENMP)
find_package(OpenMP)
include_directories(${OPENMP_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/gui)
-#add_subdirectory(../../src/agar/common/scaler/generic agar/common/scaler/generic)
add_subdirectory(../../src/qt/gui qt/gui)
-
add_subdirectory(../../src common)
add_subdirectory(../../src/vm vm/)
)
if(USE_QT_5)
set(BUNDLE_LIBS ${BUNDLE_LIBS} ${QT_LIBRARIES})
-# FIND_PACKAGE(qtermwidget5)
-# if(QTERMWIDGET_FOUND)
-# #include(${QTERMWIDGET_USE_FILE})
-# include_directories(${QTERMWIDGET_INCLUDE_DIRS})
-# add_definitions(-DUSE_QTERMWIDGET)
-# set(BUNDLE_LIBS ${BUNDLE_LIBS} ${QTERMWIDGET_LIBRARIES} ncurses)
-# set(LOCAL_LIBS ${LOCAL_LIBS} libqtermwidget5.a)
-# endif()
endif()
set(BUNDLE_LIBS ${BUNDLE_LIBS} ${THREADS_LIBRARY})
void initialize_input();
void release_input();
void update_input();
- void key_down_sub(int code, bool repeat);
+ void key_down_sub(int code, bool flag = false);
void key_up_sub(int code);
#if !defined(_USE_QT)
#ifdef USE_AUTO_KEY
FIFO* autokey_buffer;
int autokey_phase, autokey_shift;
- int autokey_table[256];
char auto_key_str[65536];
#endif
if(autokey_buffer && !autokey_buffer->empty()) {
// update shift key status
int shift = autokey_buffer->read_not_remove(0) & 0x100;
-# ifdef NOTIFY_KEY_DOWN
if(shift && !autokey_shift) {
key_down(VK_SHIFT, false);
} else if(!shift && autokey_shift) {
key_up(VK_SHIFT);
}
-# endif
autokey_shift = shift;
autokey_phase++;
break;
}
case 3:
-# ifdef NOTIFY_KEY_DOWN
if(autokey_buffer && !autokey_buffer->empty()) {
key_down(autokey_buffer->read_not_remove(0) & 0xff, false);
}
-# endif
autokey_phase++;
break;
case USE_AUTO_KEY:
-# ifdef NOTIFY_KEY_DOWN
if(autokey_buffer && !autokey_buffer->empty()) {
key_up(autokey_buffer->read_not_remove(0) & 0xff);
}
-# endif
autokey_phase++;
break;
case USE_AUTO_KEY_RELEASE:
}
-
#ifdef USE_SHIFT_NUMPAD_KEY
static const int numpad_table[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00,
stop_auto_key();
memset(auto_key_str, 0x00, sizeof(auto_key_str));
strncpy(auto_key_str, cstr, sizeof(auto_key_str) - 2);
- //AGAR_DebugLog(AGAR_LOG_DEBUG, "AutoKey: SET :%s\n", auto_key_str);
}
void EMU::start_auto_key()
char* buf = (char*)auto_key_str;
int size = strlen(buf), prev_kana = 0;
AGAR_DebugLog(AGAR_LOG_DEBUG, "AutoKey: SET :%s\n", buf);
-
for(int i = 0; i < size; i++) {
int code = buf[i] & 0xff;
if((0x81 <= code && code <= 0x9f) || 0xe0 <= code) {
} else if(code == 0xa) {
continue; // cr-lf
}
+
if((code = autokey_table[code]) != 0) {
int kana = code & 0x200;
if(prev_kana != kana) {
}
#ifdef USE_AUTO_KEY
+#include <QClipboard>
void Ui_MainWindow::OnStartAutoKey(void)
{
QString ctext;
- ctext = ClipBoard->text();
+ QClipboard *clipBoard = QApplication::clipboard();
+ ctext = clipBoard->text();
emit sig_start_auto_key(ctext);
- ClipBoard->clear();
}
+
void Ui_MainWindow::OnStopAutoKey(void)
{
emit sig_stop_auto_key();
actionExit_Emulator->setObjectName(QString::fromUtf8("actionExit_Emulator"));
//connect(actionExit_Emulator, SIGNAL(triggered()),
// this, SLOT(on_actionExit_triggered())); // OnGuiExit()?
-
+#if defined(USE_AUTO_KEY)
actionPaste_from_Clipboard = new Action_Control(this);
actionPaste_from_Clipboard->setObjectName(QString::fromUtf8("actionPaste_from_Clipboard"));
connect(actionPaste_from_Clipboard, SIGNAL(triggered()),
this, SLOT(OnStartAutoKey())); // OK?
-
actionStop_Pasting = new Action_Control(this);
actionStop_Pasting->setObjectName(QString::fromUtf8("actionStop_Pasting"));
connect(actionStop_Pasting, SIGNAL(triggered()),
this, SLOT(OnStopAutoKey())); // OK?
-
+#endif
#ifdef USE_STATE
actionSave_State = new Action_Control(this);
actionSave_State->setObjectName(QString::fromUtf8("actionSave_State"));
// menuControl->addSeparator();
#endif
menuControl->addAction(menuCpu_Speed->menuAction());
+#ifdef USE_AUTO_KEY
menuControl->addSeparator();
menuControl->addAction(menuCopy_Paste->menuAction());
+#endif
menuControl->addSeparator();
menuControl->addAction(menuState->menuAction());
#ifdef USE_DEBUGGER
menuState->addSeparator();
menuState->addAction(actionLoad_State);
#endif
+#ifdef USE_AUTO_KEY
menuCopy_Paste->addAction(actionPaste_from_Clipboard);
menuCopy_Paste->addAction(actionStop_Pasting);
+#endif
menuCpu_Speed->addAction(actionSpeed_x1);
menuCpu_Speed->addAction(actionSpeed_x2);
menuCpu_Speed->addAction(actionSpeed_x4);
addAction(actionSpecial_Reset);
#endif
addAction(menuCpu_Speed->menuAction());
+#ifdef USE_AUTO_KEY
addAction(menuCopy_Paste->menuAction());
+#endif
addAction(menuState->menuAction());
#ifdef USE_DEBUGGER
addAction(menuDebugger->menuAction());
actionSpeed_x8->setText(QApplication::translate("MainWindow", "Seppd x8", 0));
actionSpeed_x16->setText(QApplication::translate("MainWindow", "Speed x16", 0));
+#ifdef USE_AUTO_KEY
actionPaste_from_Clipboard->setText(QApplication::translate("MainWindow", "Paste from Clipboard", 0));
actionStop_Pasting->setText(QApplication::translate("MainWindow", "Stop Pasting", 0));
-
+#endif
#ifdef USE_STATE
actionSave_State->setText(QApplication::translate("MainWindow", "Save State", 0));
actionLoad_State->setText(QApplication::translate("MainWindow", "Load State", 0));
#endif
menuControl->setTitle(QApplication::translate("MainWindow", "control", 0));
menuState->setTitle(QApplication::translate("MainWindow", "State", 0));
-
+#ifdef USE_AUTO_KEY
menuCopy_Paste->setTitle(QApplication::translate("MainWindow", "Copy/Paste", 0));
+#endif
menuCpu_Speed->setTitle(QApplication::translate("MainWindow", "Cpu Speed", 0));
actionMouseEnable->setText(QApplication::translate("MainWindow", "Grab MOUSE", 0));
menuControl->setObjectName(QString::fromUtf8("menuControl"));
menuState = new QMenu(menuControl);
menuState->setObjectName(QString::fromUtf8("menuState"));
+#ifdef USE_AUTO_KEY
menuCopy_Paste = new QMenu(menuControl);
menuCopy_Paste->setObjectName(QString::fromUtf8("menuCopy_Paste"));
+#endif
menuCpu_Speed = new QMenu(menuControl);
menuCpu_Speed->setObjectName(QString::fromUtf8("menuCpu_Speed"));
menuDebugger = new QMenu(menuControl);
h = 800;
}
}
-#ifdef USE_AUTO_KEY
- ClipBoard = QApplication::clipboard();
-#endif
graphicsView->setFixedSize(w, h);
this->set_screen_size(w, h);