[Bf-committers] Patch to alter NKEY

Compman bf-committers@blender.org
Mon, 05 Apr 2004 17:31:39 +0000


This is a multi-part message in MIME format.
--------------010801020709060404080101
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Ok, I was talking on IRC to sirdude today and he said if I was bored I 
could try this...

basically what it does is if you press NKEY to open the transform 
properties for something, you can simply press NKEY again to close the 
properties. If you need to move it you can click n' drag or just press 
NKEY two times where you want it to show up again.

Thanks to the people in #blendercoders who helped me.

Later
-Compman

--------------010801020709060404080101
Content-Type: text/x-patch;
 name="nkeypatch.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="nkeypatch.patch"

Index: space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.133
diff -u -r1.133 space.c
--- space.c	5 Apr 2004 13:22:55 -0000	1.133
+++ space.c	5 Apr 2004 21:26:56 -0000
@@ -144,6 +144,8 @@
 
 #include "SYS_System.h" /* for the user def menu ... should move elsewhere. */
 
+int transup=0;
+
 extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, int always_use_expand_framing);
 
 /**
@@ -1172,8 +1174,16 @@
  				break;
 			case NKEY:
 				if((G.qual==0)) {
-					add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE);
-					allqueue(REDRAWVIEW3D, 0);
+					/* Hack by Compman */
+					if(transup == 0) {
+						add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE);
+						allqueue(REDRAWVIEW3D, 0);
+						transup = 1;
+					} else {
+						rem_blockhandler(curarea, VIEW3D_HANDLER_OBJECT);
+						allqueue(REDRAWVIEW3D, 0);
+						transup = 0;
+					}
 				}
 				else if(G.obedit) {
 					switch (G.obedit->type){

--------------010801020709060404080101--