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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-05-10 09:22:40 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-05-10 09:29:03 +0300
commitce65fae8f32c058ef50eb1a9a0a82472c4a68040 (patch)
treed41582d8e47ab381b34cfb460580eb9d38e9ae06 /intern/ghost
parent76481eaeff77e46555f8a0458d860911a9a57a9c (diff)
Fix T48369: Missing suport for main '+' key.
Many keyboard layouts (italian, spanish, german...) have direct access to '+' key on main keyboard area (not the numpad one), ans x11 has own define for this key, so use it instead of generating an unkown key event. Note that we most likely have much more missing 'specific' keycodes for non-US keyboard layout, but think since we already had a 'minus' keyevent, supporting 'plus' one is totally consistent. And we had a spare space in our defined values just for it even! This keyevent is only supported/generated by x11 and cocoa Ghost backends for now, neither SDL nor win32 seem to have matching key events...
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/GHOST_Types.h1
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm1
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp1
3 files changed, 3 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 29508a83733..b3e560ab4b4 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -249,6 +249,7 @@ typedef enum {
GHOST_kKeyQuote = 0x27,
GHOST_kKeyComma = ',',
GHOST_kKeyMinus = '-',
+ GHOST_kKeyPlus = '+',
GHOST_kKeyPeriod = '.',
GHOST_kKeySlash = '/',
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 4db945d31f7..bf44d938a47 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -240,6 +240,7 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
switch (recvChar) {
case '-': return GHOST_kKeyMinus;
+ case '+': return GHOST_kKeyPlus;
case '=': return GHOST_kKeyEqual;
case ',': return GHOST_kKeyComma;
case '.': return GHOST_kKeyPeriod;
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 0c87ee17cb0..dde63badb91 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -1500,6 +1500,7 @@ convertXKey(KeySym key)
GXMAP(type, XK_quoteright, GHOST_kKeyQuote);
GXMAP(type, XK_quoteleft, GHOST_kKeyAccentGrave);
GXMAP(type, XK_minus, GHOST_kKeyMinus);
+ GXMAP(type, XK_plus, GHOST_kKeyPlus);
GXMAP(type, XK_slash, GHOST_kKeySlash);
GXMAP(type, XK_backslash, GHOST_kKeyBackslash);
GXMAP(type, XK_equal, GHOST_kKeyEqual);