[tuhopuu-devel] Moving in textual input

Jiri Hnidek jiri.hnidek at vslib.cz
Sat Mar 26 00:33:33 CET 2005


Hi Matt,
your changes of textual input are handy. I was playing with this little 
bit. I did small chnages of code ... it is possible to move with text 
cursor very fast (<ctrl>-<left_arrow>, <ctrl>-<right_arrow>) between 
director separators (unix: '/' or win: '\'). I submitt patch only, 
because it is platform dependent, and I can't test it at win platform, 
but I gugess, that it will work properly too.

Small demo video:

http://blenderdemo.wz.cz/captured_videos/ctrl.mpeg

Jiri
-------------- next part --------------
? ./source/blender/src/.interface.c.swp
Index: ./source/blender/src/interface.c
===================================================================
RCS file: /cvsroot/tuhopuu/tuhopuu3/source/blender/src/interface.c,v
retrieving revision 1.17
diff -c -r1.17 interface.c
*** ./source/blender/src/interface.c	25 Mar 2005 01:59:50 -0000	1.17
--- ./source/blender/src/interface.c	25 Mar 2005 22:59:30 -0000
***************
*** 1589,1594 ****
--- 1589,1603 ----
  						if(but->pos>strlen(str)) but->pos= strlen(str);
  						
  						but->selend = but->pos;
+ 					} else if(G.qual & LR_CTRLKEY) {
+ 						while(but->pos < len){
+ 							but->pos++;
+ #ifdef WIN32
+ 							if(str[but->pos]=='\\') break;
+ #else
+ 							if(str[but->pos]=='/') break;
+ #endif
+ 						}
  					} else {
  						but->pos++;
  						if(but->pos>strlen(str)) but->pos= strlen(str);
***************
*** 1630,1635 ****
--- 1639,1653 ----
  						if(but->pos<0) but->pos= 0;
  						
  						but->selsta = but->pos;
+ 					} else if(G.qual & LR_CTRLKEY) {
+ 						while(but->pos>0){
+ 							but->pos--;
+ #ifdef WIN32
+ 							if(str[but->pos]=='\\') break;
+ #else
+ 							if(str[but->pos]=='/') break;
+ #endif
+ 						}
  					} else {
  						if(but->pos>0) but->pos--;
  					}


More information about the tuhopuu-devel mailing list