Mercurial > projects > dwt-win
changeset 196:1e7701c27c03
Fix initialization of key modifiers
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 07 Apr 2008 13:08:57 +0200 |
parents | 420b18afb09f |
children | 184ab53b7785 |
files | dwt/DWT.d |
diffstat | 1 files changed, 6 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/DWT.d Sun Apr 06 21:03:53 2008 +0200 +++ b/dwt/DWT.d Mon Apr 07 13:08:57 2008 +0200 @@ -1766,7 +1766,7 @@ * * @since 2.1 */ - public static const int MODIFIER_MASK; + public static const int MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND; /** * Keyboard and/or mouse event mask indicating that mouse button one @@ -1816,7 +1816,7 @@ * * @since 2.1 */ - public static const int BUTTON_MASK; + public static const int BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5; /** * Keyboard and/or mouse event mask indicating that the MOD1 key @@ -1826,7 +1826,7 @@ * * @since 2.1 */ - public static const int MOD1; + public static const int MOD1 = CONTROL; /** * Keyboard and/or mouse event mask indicating that the MOD2 key @@ -1836,7 +1836,7 @@ * * @since 2.1 */ - public static const int MOD2; + public static const int MOD2 = SHIFT; /** * Keyboard and/or mouse event mask indicating that the MOD3 key @@ -1844,7 +1844,7 @@ * * @since 2.1 */ - public static const int MOD3; + public static const int MOD3 = ALT; /** * Keyboard and/or mouse event mask indicating that the MOD4 key @@ -1852,7 +1852,7 @@ * * @since 2.1 */ - public static const int MOD4; + public static const int MOD4 = 0; /** * Constants to indicate line scrolling (value is 1). @@ -3632,34 +3632,4 @@ throw error; } -/+ -static { - /* - * These values represent bit masks that may need to - * expand in the future. Therefore they are not initialized - * in the declaration to stop the compiler from inlining. - */ - BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5; - MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND; - - /* - * These values can be different on different platforms. - * Therefore they are not initialized in the declaration - * to stop the compiler from inlining. - */ - char[] platform = getPlatform (); - if ("carbon".equals (platform)) { //$NON-NLS-1$ - MOD1 = COMMAND; - MOD2 = SHIFT; - MOD3 = ALT; - MOD4 = CONTROL; - } else { - MOD1 = CONTROL; - MOD2 = SHIFT; - MOD3 = ALT; - MOD4 = 0; - } } -+/ - -}