It would be even better to not allow them to be focused in the first
place, but that raises issues such as where to put the focus if the
focused widget gets disabled. So this will have to do.
bool Container::key_press(unsigned key, unsigned mod)
{
bool Container::key_press(unsigned key, unsigned mod)
{
+ if(input_focus && input_focus->is_enabled())
return input_focus->key_press(key, mod);
else
return false;
return input_focus->key_press(key, mod);
else
return false;
bool Container::key_release(unsigned key, unsigned mod)
{
bool Container::key_release(unsigned key, unsigned mod)
{
+ if(input_focus && input_focus->is_enabled())
return input_focus->key_release(key, mod);
else
return false;
return input_focus->key_release(key, mod);
else
return false;
bool Container::character(wchar_t ch)
{
bool Container::character(wchar_t ch)
{
+ if(input_focus && input_focus->is_enabled())
return input_focus->character(ch);
else
return false;
return input_focus->character(ch);
else
return false;
bool Container::navigate(Navigation nav)
{
bool Container::navigate(Navigation nav)
{
+ if(input_focus && input_focus->is_enabled())
return input_focus->navigate(nav);
else
return false;
return input_focus->navigate(nav);
else
return false;