Hello! I have this chunk of code. GLFW_PRESS works, but GLFW_RELEASE doesn’t seem to be working.
void onButton(const event::Button &e) override
{
Scalar110 *module = dynamic_cast<Scalar110*>(this->module);
if(module)
{
if(e.button == GLFW_MOUSE_BUTTON_LEFT)
{
if(e.action == GLFW_PRESS) module->setLCDFunction(LCD_ENGINE_DISPLAY);
if(e.action == GLFW_RELEASE) module->selectLCDFunctionSelectedParam();
}
}
RoundBlackKnob::onButton(e);
}
Here’s the entire code. Any suggestions?
struct EngineKnob : RoundBlackKnob
{
void onButton(const event::Button &e) override
{
Scalar110 *module = dynamic_cast<Scalar110*>(this->module);
if(module)
{
if(e.button == GLFW_MOUSE_BUTTON_LEFT)
{
if(e.action == GLFW_PRESS) module->setLCDFunction(LCD_ENGINE_DISPLAY);
if(e.action == GLFW_RELEASE) module->selectLCDFunctionSelectedParam();
}
}
RoundBlackKnob::onButton(e);
}
void onLeave(const LeaveEvent &e) override
{
Scalar110 *module = dynamic_cast<Scalar110*>(this->module);
if(module)
{
module->selectLCDFunctionSelectedParam();
}
}
void onHover(const event::Hover& e) override
{
RoundBlackKnob::onHover(e);
e.consume(this);
}
};