mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:50:06 +00:00
Handle hotkeys across multiple map panes
This commit is contained in:
parent
60c8af46bf
commit
589eff9882
5 changed files with 77 additions and 28 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <scwx/qt/main/application.hpp>
|
||||
#include <scwx/qt/main/versions.hpp>
|
||||
#include <scwx/qt/manager/alert_manager.hpp>
|
||||
#include <scwx/qt/manager/hotkey_manager.hpp>
|
||||
#include <scwx/qt/manager/placefile_manager.hpp>
|
||||
#include <scwx/qt/manager/position_manager.hpp>
|
||||
#include <scwx/qt/manager/radar_product_manager.hpp>
|
||||
|
|
@ -42,6 +43,7 @@
|
|||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/thread_pool.hpp>
|
||||
#include <QDesktopServices>
|
||||
#include <QKeyEvent>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSplitter>
|
||||
|
|
@ -197,7 +199,9 @@ public:
|
|||
|
||||
QTimer clockTimer_ {};
|
||||
|
||||
std::shared_ptr<manager::AlertManager> alertManager_;
|
||||
std::shared_ptr<manager::AlertManager> alertManager_;
|
||||
std::shared_ptr<manager::HotkeyManager> hotkeyManager_ {
|
||||
manager::HotkeyManager::Instance()};
|
||||
std::shared_ptr<manager::PlacefileManager> placefileManager_;
|
||||
std::shared_ptr<manager::PositionManager> positionManager_;
|
||||
std::shared_ptr<manager::TextEventManager> textEventManager_;
|
||||
|
|
@ -398,6 +402,24 @@ MainWindow::~MainWindow()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent* ev)
|
||||
{
|
||||
if (p->hotkeyManager_->HandleKeyPress(ev))
|
||||
{
|
||||
p->activeMap_->update();
|
||||
ev->accept();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::keyReleaseEvent(QKeyEvent* ev)
|
||||
{
|
||||
if (p->hotkeyManager_->HandleKeyRelease(ev))
|
||||
{
|
||||
p->activeMap_->update();
|
||||
ev->accept();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
QMainWindow::showEvent(event);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ public:
|
|||
MainWindow(QWidget* parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
void keyPressEvent(QKeyEvent* ev) override final;
|
||||
void keyReleaseEvent(QKeyEvent* ev) override final;
|
||||
void showEvent(QShowEvent* event) override;
|
||||
|
||||
signals:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue