[Bf-committers] Re: another dumb question

Rob Haarsma bf-committers@blender.org
Fri, 20 Dec 2002 14:59:52 +0100


I'd like to add here that the line:

 >                                    else if(ascii=='v') ascii=  1001;

doesn't work on windows. The altkey event doesn't reach the function
do_textedit(event, val, ascii);

It works when you make a seperate paste_editText(); function which you
can activate by adding the following at line 455 in space.c:

			case VKEY:
				if(G.qual & LR_ALTKEY) {
					paste_editText();
					doredraw= 1;
				} else {
					do_textedit(event, val, ascii);
				}
				break;

For completeness, here's my paste_editText(); function:
void paste_editText(void)
{
	Curve *cu;
	int file, filelen, doit= 0;
	char *strp;

	cu= G.obedit->data;

#ifdef WIN32   //_DISABLED
	file= open("C:\\windows\\temp\\cutbuf.txt", O_BINARY|O_RDONLY);
#else
	file= open("/tmp/.cutbuffer", O_BINARY|O_RDONLY);
#endif

	if(file>0) {

		filelen = BLI_filesize(file);
				
		strp= MEM_mallocN(filelen+1, "tempstr");
		read(file, strp, filelen);
		close(file);
		strp[filelen]= 0;
		if(cu->len+filelen<MAXTEXT) {
			strcat( textbuf, strp);
			cu->len= strlen(textbuf);
			cu->pos= cu->len;
		}
		MEM_freeN(strp);
		doit = 1;
//		if(okee("doit")==0) return; waitcursor(1);
	}
	if(doit) {
		text_to_curve(G.obedit, 0);
		makeDispList(G.obedit);
		allqueue(REDRAWVIEW3D, 0);
	}
}

regards,

Rob.