aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhomescreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libhomescreen.cpp')
-rw-r--r--src/libhomescreen.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libhomescreen.cpp b/src/libhomescreen.cpp
index 121def7..f302c3b 100644
--- a/src/libhomescreen.cpp
+++ b/src/libhomescreen.cpp
@@ -47,7 +47,8 @@ const std::vector<std::string> LibHomeScreen::api_list {
std::string("hideWindow"),
std::string("replyShowWindow"),
std::string("showNotification"),
- std::string("showInformation")
+ std::string("showInformation"),
+ std::string("registerShortcut")
};
const std::vector<std::string> LibHomeScreen::event_list {
@@ -59,6 +60,7 @@ const std::vector<std::string> LibHomeScreen::event_list {
std::string("replyShowWindow"),
std::string("showNotification"),
std::string("showInformation"),
+ std::string("registerShortcut"),
std::string("none")
};
@@ -326,6 +328,9 @@ void LibHomeScreen::set_event_handler(enum EventType et, handler_func f)
case Event_ShowInformation:
this->subscribe(LibHomeScreen::event_list[6]);
break;
+ case Event_RegisterShortCut:
+ this->subscribe(LibHomeScreen::event_list[7]);
+ break;
}
this->handlers[et] = std::move(f);
@@ -692,6 +697,12 @@ void LibHomeScreen::on_event(void *closure, const char *event, struct afb_wsj1_m
i->second(json_data);
}
}
+ else if (strcasecmp(event_type, LibHomeScreen::event_list[7].c_str()) == 0) {
+ auto i = this->handlers.find(Event_RegisterShortCut);
+ if ( i != this->handlers.end() ) {
+ i->second(json_data);
+ }
+ }
}
/**