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-04-05 16:42:07 +0400
committerMatt Ebb <matt@mke3.net>2007-04-05 16:42:07 +0400
commitbbceedced0ecf1426d90faf5f36136f688853ab6 (patch)
treeded71b41ad8ae8434112e9c7627385dce27b5513 /source/blender/src/editscreen.c
parent54f57cca0872924f3b9ed3a329ef767365fafcc9 (diff)
* Tablet support fixup
This commit should hopefully fix some of the problems some people were having with tablet support in sculpt mode, and also the problems I made visible with my previous commit related to number field dragging. Now, all the ghost related stuff is tucked away in ghostwinlay.c and a simple Blender API, similar to the existing get_mbut() for example, is provided to access the tablet data. As with the other mouse related data in Blender, the tablet data is cached upon each mouse move or click, in the Window struct. You can now just use: float get_pressure(void); void get_tilt(float *xtilt, float *ytilt); short get_activedevice(void); to get such data from the tablet. Documentation on the returned data is in ghostwinlay.c in the _Window struct definition. Brecht and Nicholas, I've updated the painting and sculpt code and it works just fine here, you may want to give it a check though to make sure I haven't done anything silly.
Diffstat (limited to 'source/blender/src/editscreen.c')
-rw-r--r--source/blender/src/editscreen.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index 0ee13f676b6..008a2457967 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -2119,10 +2119,23 @@ short get_mbut(void)
winlay_process_events(0);
return window_get_mbut(mainwin);
}
-const GHOST_TabletData* get_tablet_data()
+
+/* return values of tablet data related functions are documented
+ * in the Window struct, ghostwinlay.c */
+float get_pressure(void)
+{
+ winlay_process_events(0);
+ return window_get_pressure(mainwin);
+}
+void get_tilt(float *xtilt, float *ytilt)
+{
+ winlay_process_events(0);
+ window_get_tilt(mainwin, xtilt, ytilt);
+}
+short get_activedevice(void)
{
winlay_process_events(0);
- return window_get_tablet_data(mainwin);
+ return window_get_activedevice(mainwin);
}
void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii)