MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ unbind_viewport_preset()

MAYAFLUX_API void MayaFlux::unbind_viewport_preset ( const std::shared_ptr< Core::Window > &  window,
const std::string &  name = "default" 
)

Cancel all event handlers registered by bind_viewport_preset() and restore the window input config to its state before bind was called.

Parameters
windowWindow passed to bind_viewport_preset()
nameName passed to bind_viewport_preset()

Definition at line 128 of file ViewportPreset.cpp.

131{
132 const std::string key = make_key(window, name);
133 auto it = s_registry.find(key);
134 if (it == s_registry.end()) {
135 return;
136 }
137 const Core::InputConfig saved = it->second.saved_config;
138 s_registry.erase(it);
139
140 window->set_input_config(saved);
141
142 static const char* const k_suffixes[] = {
143 "w_dn", "w_up", "s_dn", "s_up",
144 "a_dn", "a_up", "d_dn", "d_up",
145 "q_dn", "q_up", "e_dn", "e_up",
146 "rmb_dn", "rmb_up",
147 "mouse", "scroll",
148 "kp1", "kp3", "kp7", "kp9"
149 };
150
151 for (const auto& ev : it->second.registered_events) {
153 }
154}
std::vector< std::string > registered_events
bool cancel_event_handler(const std::string &name)
Cancel an event handler by name.
Definition Chronie.cpp:241

References cancel_event_handler().

+ Here is the call graph for this function: