[archived content]

Requesting help with the GTK version of DFL.

You may directly edit this page with your changes or questions, or upload files, etc.


Color and SystemColors dealing with predefined colors, such as the default Control background color.

SystemColors provides several properties to get Color values that always map to the current predefined colors, even when the predefined colors change.


enum Keys? needs to be implemented. I started with it, but it gets to be pretty tedious. Plus, I'm uncertain about how some things should be handled.

GTK's keys are defined here with GDK_* defines, and differ from DFL's in several ways:

  • DFL's Keys uses A-Z constants combined with SHIFT; GTK's has separate GDK_A-Z and GDK_a-z for upper and lowercase.

I believe the best way is to have a common ground for DFL's Keys, and have a key translation function when going from GTK's key events to DFL's.

Below is what I have so far:

enum Keys: uint
{
        NONE =     0, /// No keys specified.

        ///
        SHIFT =    0x10000, /// Modifier keys.
        CONTROL =  0x20000, /// ditto
        ALT =      0x40000, /// ditto

        // GDK_a ...
        A = 'a', /// Letters.
        B, /// ditto
        C, /// ditto
        D, /// ditto
        E, /// ditto
        F, /// ditto
        G, /// ditto
        H, /// ditto
        I, /// ditto
        J, /// ditto
        K, /// ditto
        L, /// ditto
        M, /// ditto
        N, /// ditto
        O, /// ditto
        P, /// ditto
        Q, /// ditto
        R, /// ditto
        S, /// ditto
        T, /// ditto
        U, /// ditto
        V, /// ditto
        W, /// ditto
        X, /// ditto
        Y, /// ditto
        Z, /// ditto

        D0 = '0', /// Digits.
        D1 = '1', /// ditto
        D2 = '2', /// ditto
        D3 = '3', /// ditto
        D4 = '4', /// ditto
        D5 = '5', /// ditto
        D6 = '6', /// ditto
        D7 = '7', /// ditto
        D8 = '8', /// ditto
        D9 = '9', /// ditto

        // GDK_F1 ...
        F1 = 0xFFBE, /// F - function keys.
        F2, /// ditto
        F3, /// ditto
        F4, /// ditto
        F5, /// ditto
        F6, /// ditto
        F7, /// ditto
        F8, /// ditto
        F9, /// ditto
        F10, /// ditto
        F11, /// ditto
        F12, /// ditto
        F13, /// ditto
        F14, /// ditto
        F15, /// ditto
        F16, /// ditto
        F17, /// ditto
        F18, /// ditto
        F19, /// ditto
        F20, /// ditto
        F21, /// ditto
        F22, /// ditto
        F23, /// ditto
        F24, /// ditto

        // GDK_KP_0 ...
        NUM_PAD0 = 0xFFB0, /// Numbers on keypad.
        NUM_PAD1, /// ditto
        NUM_PAD2, /// ditto
        NUM_PAD3, /// ditto
        NUM_PAD4, /// ditto
        NUM_PAD5, /// ditto
        NUM_PAD6, /// ditto
        NUM_PAD7, /// ditto
        NUM_PAD8, /// ditto
        NUM_PAD9, /// ditto

        //ADD = , ///
        //APPS = , /// Application.
        //ATTN = , ///
        BACK = 0xFF08, /// Backspace.
        CANCEL = 0xFF69, ///
        CAPITAL = 0xFFE5, ///
        CAPS_LOCK = 0xFFE5, /// ditto
        CLEAR = 0xFF0B, ///

        // GDK_Control_L (Note: skipping GDK_Control_R)
        CONTROL_KEY = 0xFFE3, ///

        // GDK_3270_CursorSelect ?
        CRSEL = 0xFD1C, ///

        // GDK_KP_Decimal
        DECIMAL = 0xFFAE, ///

        // GDK_Delete
        DEL = 0xFFFF, ///
        DELETE = DEL, ///

        // GDK_period
        PERIOD = 0x02E, ///
        DOT = PERIOD, /// ditto

        /// Bit mask to extract key code from key value.
        KEY_CODE = 0xFFFF,

        /// Bit mask to extract modifiers from key value.
        MODIFIERS = 0xFFFF0000,
}

and below are the remaining ones still with their Win32 values:

   	DIVIDE = 111, ///
	DOWN = 40, /// Down arrow.
	END = 35, ///
	ENTER = 13, ///
	ERASE_EOF = 249, ///
	ESCAPE = 27, ///
	EXECUTE = 43, ///
	EXSEL = 248, ///
	FINAL_MODE = 4, /// IME final mode.
	HANGUL_MODE = 21, /// IME Hangul mode.
	HANGUEL_MODE = 21, /// ditto
	HANJA_MODE = 25, /// IME Hanja mode.
	HELP = 47, ///
	HOME = 36, ///
	IME_ACCEPT = 30, ///
	IME_CONVERT = 28, ///
	IME_MODE_CHANGE = 31, ///
	IME_NONCONVERT = 29, ///
	INSERT = 45, ///
	JUNJA_MODE = 23, ///
	KANA_MODE = 21, ///
	KANJI_MODE = 25, ///
	LEFT_CONTROL = 162, /// Left Ctrl.
	LEFT = 37, /// Left arrow.
	LINE_FEED = 10, ///
	LEFT_MENU = 164, /// Left Alt.
	LEFT_SHIFT = 160, ///
	LEFT_WIN = 91, /// Left Windows logo.
	MENU = 18, /// Alt.
	MULTIPLY = 106, ///
	NEXT = 34, /// Page down.
	NO_NAME = 252, // Reserved for future use.
	NUM_LOCK = 144, ///
	OEM8 = 223, // OEM specific.
	OEM_CLEAR = 254,
	PA1 = 253,
	PAGE_DOWN = 34, ///
	PAGE_UP = 33, ///
	PAUSE = 19, ///
	PLAY = 250, ///
	PRINT = 42, ///
	PRINT_SCREEN = 44, ///
	PROCESS_KEY = 229, ///
	RIGHT_CONTROL = 163, /// Right Ctrl.
	RETURN = 13, ///
	RIGHT = 39, /// Right arrow.
	RIGHT_MENU = 165, /// Right Alt.
	RIGHT_SHIFT = 161, ///
	RIGHT_WIN = 92, /// Right Windows logo.
	SCROLL = 145, /// Scroll lock.
	SELECT = 41, ///
	SEPARATOR = 108, ///
	SHIFT_KEY = 16, ///
	SNAPSHOT = 44, /// Print screen.
	SPACE = 32, ///
	SPACEBAR = SPACE, // Extra.
	SUBTRACT = 109, ///
	TAB = 9, ///
	UP = 38, /// Up arrow.
	ZOOM = 251, ///
	
	BROWSER_BACK = 166, ///
	BROWSER_FAVORITES = 171, /// ditto
	BROWSER_FORWARD = 167, /// ditto
	BROWSER_HOME = 172, /// ditto
	BROWSER_REFRESH = 168, /// ditto
	BROWSER_SEARCH = 170, /// ditto
	BROWSER_STOP = 169, /// ditto
	LAUNCH_APPLICATION1 = 182, ///
	LAUNCH_APPLICATION2 = 183, /// ditto
	LAUNCH_MAIL = 180, /// ditto
	MEDIA_NEXT_TRACK = 176, ///
	MEDIA_PLAY_PAUSE = 179, /// ditto
	MEDIA_PREVIOUS_TRACK = 177, /// ditto
	MEDIA_STOP = 178, /// ditto
	OEM_BACKSLASH = 226, // OEM angle bracket or backslash.
	OEM_CLOSE_BRACKETS = 221,
	OEM_COMMA = 188,
	OEM_MINUS = 189,
	OEM_OPEN_BRACKETS = 219,
	OEM_PERIOD = 190,
	OEM_PIPE = 220,
	OEM_PLUS = 187,
	OEM_QUESTION = 191,
	OEM_QUOTES = 222,
	OEM_SEMICOLON = 186,
	OEM_TILDE = 192,
	SELECT_MEDIA = 181, ///
	VOLUME_DOWN = 174, ///
	VOLUME_MUTE = 173, /// ditto
	VOLUME_UP = 175, /// ditto 

Note from Matt: Would it be a good idea, then, to read both 'a' and 'A' as one and the same, and have a quick function for keys such as Shift, Caps, etc.? In this way, very little would need to change, at least with regards to how input is processed, as these would be handled when DFL reads the input from GTK

Page last modified on August 29, 2012, at 02:14 PM