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,
SHIFT = 0x10000,
CONTROL = 0x20000,
ALT = 0x40000,
A = 'a',
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
D0 = '0',
D1 = '1',
D2 = '2',
D3 = '3',
D4 = '4',
D5 = '5',
D6 = '6',
D7 = '7',
D8 = '8',
D9 = '9',
F1 = 0xFFBE,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
NUM_PAD0 = 0xFFB0,
NUM_PAD1,
NUM_PAD2,
NUM_PAD3,
NUM_PAD4,
NUM_PAD5,
NUM_PAD6,
NUM_PAD7,
NUM_PAD8,
NUM_PAD9,
BACK = 0xFF08,
CANCEL = 0xFF69,
CAPITAL = 0xFFE5,
CAPS_LOCK = 0xFFE5,
CLEAR = 0xFF0B,
CONTROL_KEY = 0xFFE3,
CRSEL = 0xFD1C,
DECIMAL = 0xFFAE,
DEL = 0xFFFF,
DELETE = DEL,
PERIOD = 0x02E,
DOT = PERIOD,
KEY_CODE = 0xFFFF,
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