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:
authorJoshua Leung <aligorith@gmail.com>2011-02-19 01:42:03 +0300
committerJoshua Leung <aligorith@gmail.com>2011-02-19 01:42:03 +0300
commit346f749a57b117ed18e7e436dc7ccf80dccfacf0 (patch)
tree767bbcad327569fd8001d3c334f8730583b1b136 /intern
parent65aac7c5069984da5d8441376304c910668583d2 (diff)
Adding support for the "media" play/pause/stop/next/prev buttons
available on many keyboards these days, so that they can be used for animation playback (giving more options over alt-a and alt-a ad- infinitum). Currently, this is Windows only as I don't have a Linux/Mac system to test on (it should compile with both mingw and msvc, at least using scons). Maintainers for those systems can probably easily add this in once they find out the relevant mappings for those systems.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/GHOST_Types.h8
-rw-r--r--intern/ghost/intern/GHOST_EventPrinter.cpp12
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp17
3 files changed, 36 insertions, 1 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index af17b10bf00..c3bc8d17b65 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -353,7 +353,13 @@ typedef enum {
GHOST_kKeyF21,
GHOST_kKeyF22,
GHOST_kKeyF23,
- GHOST_kKeyF24
+ GHOST_kKeyF24,
+
+ // Multimedia keypad buttons
+ GHOST_kKeyMediaPlay,
+ GHOST_kKeyMediaStop,
+ GHOST_kKeyMediaFirst,
+ GHOST_kKeyMediaLast
} GHOST_TKey;
typedef enum {
diff --git a/intern/ghost/intern/GHOST_EventPrinter.cpp b/intern/ghost/intern/GHOST_EventPrinter.cpp
index 697ced64a70..b3d936aedbe 100644
--- a/intern/ghost/intern/GHOST_EventPrinter.cpp
+++ b/intern/ghost/intern/GHOST_EventPrinter.cpp
@@ -325,6 +325,18 @@ void GHOST_EventPrinter::getKeyString(GHOST_TKey key, STR_String& str) const
case GHOST_kKeyNumpadSlash:
str = "NumpadSlash";
break;
+ case GHOST_kKeyMediaPlay:
+ str = "MediaPlayPause";
+ break;
+ case GHOST_kKeyMediaStop:
+ str = "MediaStop";
+ break;
+ case GHOST_kKeyMediaFirst:
+ str = "MediaFirst";
+ break;
+ case GHOST_kKeyMediaLast:
+ str = "MediaLast";
+ break;
default:
str = "unknown";
break;
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 24f9e96b109..64a1c209226 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -136,6 +136,19 @@
#define VK_GR_LESS 0xE2
#endif // VK_GR_LESS
+#ifndef VK_MEDIA_NEXT_TRACK
+#define VK_MEDIA_NEXT_TRACK 0xB0
+#endif // VK_MEDIA_NEXT_TRACK
+#ifndef VK_MEDIA_PREV_TRACK
+#define VK_MEDIA_PREV_TRACK 0xB1
+#endif // VK_MEDIA_PREV_TRACK
+#ifndef VK_MEDIA_STOP
+#define VK_MEDIA_STOP 0xB2
+#endif // VK_MEDIA_STOP
+#ifndef VK_MEDIA_PLAY_PAUSE
+#define VK_MEDIA_PLAY_PAUSE 0xB3
+#endif // VK_MEDIA_PLAY_PAUSE
+
GHOST_SystemWin32::GHOST_SystemWin32()
: m_hasPerformanceCounter(false), m_freq(0), m_start(0)
@@ -640,6 +653,10 @@ GHOST_TKey GHOST_SystemWin32::convertKey(GHOST_IWindow *window, WPARAM wParam, L
case VK_OEM_8:
key = ((GHOST_SystemWin32*)getSystem())->processSpecialKey(window, wParam, lParam);
break;
+ case VK_MEDIA_PLAY_PAUSE: key = GHOST_kKeyMediaPlay; break;
+ case VK_MEDIA_STOP: key = GHOST_kKeyMediaStop; break;
+ case VK_MEDIA_PREV_TRACK: key = GHOST_kKeyMediaFirst; break;
+ case VK_MEDIA_NEXT_TRACK: key = GHOST_kKeyMediaLast; break;
default:
key = GHOST_kKeyUnknown;
break;