File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed
Controllers/KeyboardInput
NintendoSwitch/Controllers
PokemonLA/Programs/Farming Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 55 */
66
77#include < QKeyEvent>
8- #include " Common/Cpp/Exceptions.h"
98#include " Common/Cpp/Concurrency/SpinLock.h"
109#include " GlobalQtKeyMap.h"
1110
@@ -23,16 +22,13 @@ void QtKeyMap::record(const QKeyEvent& event){
2322 m_map[native_key].insert (qkey);
2423}
2524
26- const std::set<Qt::Key>& QtKeyMap::get_QtKeys (uint32_t native_key) const {
25+ const std::set<Qt::Key>* QtKeyMap::get_QtKeys (uint32_t native_key) const {
2726 ReadSpinLock lg (m_lock);
2827 auto iter = m_map.find (native_key);
2928 if (iter == m_map.end ()){
30- throw InternalProgramError (
31- nullptr , PA_CURRENT_FUNCTION,
32- " Attempted to look up unrecognized native keyboard key: " + std::to_string (native_key)
33- );
29+ return nullptr ;
3430 }
35- return iter->second ;
31+ return & iter->second ;
3632}
3733
3834
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class QtKeyMap{
2626
2727 void record (const QKeyEvent& event);
2828
29- const std::set<Qt::Key>& get_QtKeys (uint32_t native_key) const ;
29+ const std::set<Qt::Key>* get_QtKeys (uint32_t native_key) const ;
3030
3131
3232private:
Original file line number Diff line number Diff line change @@ -53,8 +53,11 @@ class ProController::KeyboardManager : public KeyboardInputController{
5353 ControllerDeltas deltas;
5454 const QtKeyMap& qkey_map = QtKeyMap::instance ();
5555 for (uint32_t native_key : pressed_keys){
56- const std::set<Qt::Key>& qkeys = qkey_map.get_QtKeys (native_key);
57- for (Qt::Key qkey : qkeys){
56+ const std::set<Qt::Key>* qkeys = qkey_map.get_QtKeys (native_key);
57+ if (qkeys == nullptr ){
58+ continue ;
59+ }
60+ for (Qt::Key qkey : *qkeys){
5861 auto iter = m_mapping.find (qkey);
5962 if (iter != m_mapping.end ()){
6063 deltas += iter->second ;
Original file line number Diff line number Diff line change 2222#include " PokemonLA/Programs/PokemonLA_RegionNavigation.h"
2323#include " PokemonLA_NuggetFarmerHighlands.h"
2424
25- #include < iostream>
26- using std::cout;
27- using std::endl;
25+ // #include <iostream>
26+ // using std::cout;
27+ // using std::endl;
2828
2929namespace PokemonAutomation {
3030namespace NintendoSwitch {
@@ -40,7 +40,8 @@ NuggetFarmerHighlands_Descriptor::NuggetFarmerHighlands_Descriptor()
4040 " Farm nuggets off the Miss Fortune sisters in the Coronet Highlands." ,
4141 FeedbackType::VIDEO_AUDIO,
4242 AllowCommandsWhenRunning::DISABLE_COMMANDS,
43- {SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
43+ {ControllerFeature::NintendoSwitch_ProController},
44+ FasterIfTickPrecise::NOT_FASTER
4445 )
4546{}
4647class NuggetFarmerHighlands_Descriptor ::Stats : public StatsTracker, public ShinyStatIncrementer{
You can’t perform that action at this time.
0 commit comments