Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Srashti Mittal
purr-data
Commits
85883eef
Commit
85883eef
authored
Sep 18, 2020
by
Ivica Bukvic
Committed by
Albert Gräf
Sep 22, 2020
Browse files
Disables passing of key presses globally when an x->gl_editor->e_keyfn is not null
* This means an object has requested exclusive focus
parent
edb80827
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/g_editor.c
View file @
85883eef
...
...
@@ -5476,34 +5476,39 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
t_atom at[2];
// now broadcast key press to key et al. objects
if (!autorepeat)
// ico@vt.edu 20200918: only do so if we do not have an object
// that has grabbed the keyboard, such as gatom or iemgui numbox
if (!x->gl_editor->e_keyfn)
{
if (keynumsym->s_thing && down)
pd_float(keynumsym->s_thing, (t_float)keynum);
if (keyupsym->s_thing && !down)
pd_float(keyupsym->s_thing, (t_float)keynum);
if (keynamesym->s_thing)
if (!autorepeat)
{
if (keynumsym->s_thing && down)
pd_float(keynumsym->s_thing, (t_float)keynum);
if (keyupsym->s_thing && !down)
pd_float(keyupsym->s_thing, (t_float)keynum);
if (keynamesym->s_thing)
{
at[0] = av[0];
SETFLOAT(at, down);
SETSYMBOL(at+1, gotkeysym);
pd_list(keynamesym->s_thing, 0, 2, at);
}
}
// now do the same for autorepeat-enabled objects (key et al. alternative behavior)
if (keynumsym_a->s_thing && down)
pd_float(keynumsym_a->s_thing, (t_float)keynum);
if (keyupsym_a->s_thing && !down)
pd_float(keyupsym_a->s_thing, (t_float)keynum);
if (keynamesym_a->s_thing)
{
at[0] = av[0];
SETFLOAT(at, down);
SETSYMBOL(at+1, gotkeysym);
pd_list(keynamesym->s_thing, 0, 2, at);
pd_list(keynamesym
_a
->s_thing, 0, 2, at);
}
}
// now do the same for autorepeat-enabled objects (key et al. alternative behavior)
if (keynumsym_a->s_thing && down)
pd_float(keynumsym_a->s_thing, (t_float)keynum);
if (keyupsym_a->s_thing && !down)
pd_float(keyupsym_a->s_thing, (t_float)keynum);
if (keynamesym_a->s_thing)
{
at[0] = av[0];
SETFLOAT(at, down);
SETSYMBOL(at+1, gotkeysym);
pd_list(keynamesym_a->s_thing, 0, 2, at);
}
if (!x || !x->gl_editor)
return;
if (x && down)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment