Commit 493ea737 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*proxy paste function to incorporate force getscroll to ensure that scroll is...

*proxy paste function to incorporate force getscroll to ensure that scroll is being checked after a paste
parent ec428c62
......@@ -6105,6 +6105,16 @@ void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av)
canvas_key(canvas_editing, s, ac, av);
}
void glob_pastetext(void *dummy, t_symbol *s, int ac, t_atom *av)
{
//fprintf(stderr,"glob_pastetext %s\n", s->s_name);
canvas_key(canvas_editing, s, ac-1, av+1);
if ((int)atom_getfloat(av) == 1) {
//fprintf(stderr,"force getscroll\n");
sys_vgui("pdtk_canvas_force_getscroll .x%lx.c\n", canvas_editing);
}
}
void canvas_editmode(t_canvas *x, t_floatarg fyesplease)
{
//fprintf(stderr,"canvas_editmode %f\n", fyesplease);
......
......@@ -18,6 +18,7 @@ void glob_verifyquit(void *dummy, t_floatarg f);
void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv);
void glob_meters(void *dummy, t_floatarg f);
void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av);
void glob_pastetext(void *dummy, t_symbol *s, int ac, t_atom *av);
void glob_audiostatus(void *dummy);
void glob_finderror(t_pd *dummy);
void glob_audio_properties(t_pd *dummy, t_floatarg flongform);
......@@ -99,6 +100,7 @@ void glob_init(void)
class_addmethod(glob_pdobject, (t_method)glob_meters, gensym("meters"),
A_FLOAT, 0);
class_addmethod(glob_pdobject, (t_method)glob_key, gensym("key"), A_GIMME, 0);
class_addmethod(glob_pdobject, (t_method)glob_pastetext, gensym("pastetext"), A_GIMME, 0);
class_addmethod(glob_pdobject, (t_method)glob_audiostatus,
gensym("audiostatus"), 0);
class_addmethod(glob_pdobject, (t_method)glob_finderror,
......
......@@ -6637,7 +6637,15 @@ proc pdtk_pastetext {} {
for {set i 0} {$i < [string length $pdtk_pastebuffer]} {incr i 1} {
set cha [string index $pdtk_pastebuffer $i]
scan $cha %c keynum
pd [concat pd key 1 $keynum 0\;]
if {$i == [expr [string length $pdtk_pastebuffer] - 1]} {
# unlike key command which would be pd [concat pd key 1 $keynum 0\;]
# we add first digit to ask for force getscroll as we limit the number of
# getscrolls we can get per second so last one is likely to be eaten up
# in the process
pd [concat pd pastetext 1 1 $keynum 0\;]
} else {
pd [concat pd pastetext 0 1 $keynum 0\;]
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment