# HG changeset patch # User Frank Benoit # Date 1207566537 -7200 # Node ID 1e7701c27c03e0e56e3b8e1ae4beb67afd01048c # Parent 420b18afb09f2645ae207fc209fa8f191e58359a Fix initialization of key modifiers diff -r 420b18afb09f -r 1e7701c27c03 dwt/DWT.d --- 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; - } } -+/ - -}