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
path: root/intern
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-11 12:39:59 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-11 13:02:26 +0400
commit028fd29eeb092b6ed0625ed4d59b8100ae69596f (patch)
tree0cb15b15f17e6d9f16fef74631e3838e8962fafe /intern
parent5d1d23d5bdb0e5937520f16063f8d16fb049850c (diff)
Pie Menus C code backend.
This commit merges the code in the pie-menu branch. As per decisions taken the last few days, there are no pie menus included and there will be an official add-on including overrides of some keys with pie menus. However, people will now be able to use the new code in python. Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/ Thanks: Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review and design comments Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for suggestions during the development. Special Thanks to Sean Olson, for his support, suggestions, testing and merciless bugging so that I would finish the pie menu code. Without him we wouldn't be here. Also to the rest of the developers of the original python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who did the research and first implementation and whose code I used to get started.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp10
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index e347661ebc6..6d948b2135f 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -525,6 +525,16 @@ processEvents(
continue;
}
#endif
+ /* when using autorepeat, some keypress events can actually come *after* the
+ * last keyrelease. The next code takes care of that */
+ if (xevent.type == KeyRelease) {
+ m_last_release_keycode = xevent.xkey.keycode;
+ m_last_release_time = xevent.xkey.time;
+ }
+ else if (xevent.type == KeyPress) {
+ if ((xevent.xkey.keycode == m_last_release_keycode) && ((xevent.xkey.time <= m_last_release_time)))
+ continue;
+ }
processEvent(&xevent);
anyProcessed = true;
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 1f95e4b1ce2..a21300e36f0 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -356,6 +356,10 @@ private:
* and stop accumulating all events generated before that */
Time m_last_warp;
+ /* detect autorepeat glitch */
+ unsigned int m_last_release_keycode;
+ Time m_last_release_time;
+
/**
* Return the ghost window associated with the
* X11 window xwind