Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2007-03-23 08:41:58 +0300
committerMatt Ebb <matt@mke3.net>2007-03-23 08:41:58 +0300
commitc448d2d3a57ed22ddf60fdbca61f3ac6969eabce (patch)
tree28b83f64dd1f7e77d0b301e4563ec6b8d237a4f0 /source/blender/src/interface.c
parent4391c8cba806d5913e5c2a87f72ae319631f5d59 (diff)
== Interface ==
* Tablet pressure sensitivity for number field dragging Many of the number fields in Blender are very sensitive. With this addition, softer tablet pressure causes the number field dragging to be more precise, as if you're holding shift, but variable depending on how hard or soft you're pressing. You can push hard for large adjustments or just lightly stroke it for fine tuning. P.S. There was a bug in the tracker regarding tablet support in sculpt mode that never really got resolved. I don't know if it still exists, but number fields are a pretty major part of Blender, so just in case this commit causes problems for you, you can disable it (temporarily, this won't be left in) by changing rt: to any value other than 0. If anyone has problems, please report them, and we can get it sorted out properly.
Diffstat (limited to 'source/blender/src/interface.c')
-rw-r--r--source/blender/src/interface.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 74ca4019dcf..4229c8087c1 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -101,6 +101,8 @@
#include "BPY_extern.h" /* for BPY_button_eval */
+#include "GHOST_Types.h" /* for tablet data */
+
#include "mydevice.h"
#include "interface.h"
#include "blendef.h"
@@ -2096,6 +2098,8 @@ static int ui_act_as_text_but(uiBut *but)
static int ui_do_but_NUM(uiBut *but)
{
+ const GHOST_TabletData *td;
+ float pressure;
double value;
float deler, fstart, f, tempf;
int lvalue, temp, orig_x; /* , firsttime=1; */
@@ -2131,19 +2135,25 @@ static int ui_do_but_NUM(uiBut *but)
sx = mval[0]; /* ignore mouse movement within drag-lock */
while (get_mbut() & L_MOUSE) {
+ td= get_tablet_data();
+ pressure= (td)? td->Pressure: 1.0f;
+
qual= get_qual();
uiGetMouse(mywinget(), mval);
deler= 500;
if( but->pointype!=FLO ) {
-
+
if( (but->max-but->min)<100 ) deler= 200.0;
if( (but->max-but->min)<25 ) deler= 50.0;
}
if(qual & LR_SHIFTKEY) deler*= 10.0;
if(qual & LR_ALTKEY) deler*= 20.0;
+
+ /* de-sensitise based on tablet pressure */
+ if (G.rt == 0) deler /= pressure;
if(mval[0] != sx) {
if( but->pointype==FLO && but->max-but->min > 11) {