Skip to content
Snippets Groups Projects
Commit 6fbc5a11 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*added dynamic switching of the edit menu buttons

parent a76edbdc
No related branches found
No related tags found
No related merge requests found
......@@ -4545,9 +4545,11 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
{
//fprintf(stderr,"ctrl\n");
glob_ctrl = down;
if(x->gl_edit && x->gl_editor->e_onmotion == MA_NONE)
if(x->gl_edit && x->gl_editor->e_onmotion == MA_NONE) {
canvas_setcursor(x, down ?
CURSOR_RUNMODE_NOTHING : CURSOR_EDITMODE_NOTHING);
sys_vgui("pdtk_canvas_editval .x%lx %d\n", (t_int)x, down ? 0 : 1);
}
}
//fprintf(stderr," %d %d %d %s %d %d\n", glob_shift, glob_ctrl, glob_alt, gotkeysym->s_name, keynum, down);
//canvas_motion(x, canvas_last_glist_x, canvas_last_glist_y, canvas_last_glist_mod);
......
......@@ -2494,6 +2494,8 @@ proc pdtk_canvas_new {name width height geometry editable} {
pack $name.k12frame.edit.b -side left -expand 1 -padx 1 -pady 0
setTooltip $name.k12frame.edit.b "Toggle between building and playing an instrument"
pdtk_standardkeybindings $name.k12frame.edit.b
bind $name.k12frame.edit.b <Key> [list pdtk_canvas_sendkey $name.c 1 %K %A 0 1 %t]
bind $name.k12frame.edit.b <KeyRelease> [list pdtk_canvas_sendkey $name.c 0 %K %A 0 1 %t]
# ---------------------------------- DATA VS SOUND BUTTONS ----------------------------------
match_linux_wm [list frame $name.k12frame.datasound -relief flat]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment