* Tim Nieradzik <tim.nieradzik@gmx.de> wrote:
It took longer to write this patch than I expected.
That really was quick! I'm excited to see this. I'm not very familiar with Dillo's code, so I only have superficial comments. Mostly, I see some keys missing...
+struct mapping_s keyNames[] = { + { "Backspace", fltk::BackSpaceKey }, + { "Delete", fltk::DeleteKey }, + { "Down", fltk::DownKey }, + { "End", fltk::EndKey }, + { "Esc", fltk::EscapeKey }, + { "F1", fltk::F1Key }, + { "F2", fltk::F2Key }, + { "F3", fltk::F3Key }, + { "F4", fltk::F4Key }, + { "F5", fltk::F5Key }, + { "F6", fltk::F6Key }, + { "F7", fltk::F7Key }, + { "F8", fltk::F8Key }, + { "F9", fltk::F9Key },
F10 through F20?
+ { "Home", fltk::HomeKey }, + { "Insert", fltk::InsertKey }, + { "Left", fltk::LeftKey }, + { "PageDown", fltk::PageDownKey }, + { "PageUp", fltk::PageUpKey }, + { "Print", fltk::PrintKey }, + { "Return", fltk::ReturnKey }, + { "Right", fltk::RightKey }, + { "Space", fltk::SpaceKey }, + { "Tab", fltk::TabKey }, + { "Up", fltk::UpKey } +};
Keypad keys?
+static struct mapping_s modifierNames[] = { + { "Shift", fltk::SHIFT }, + { "Ctrl", fltk::CTRL }, + { "Alt", fltk::ALT }, + { "Button1", fltk::BUTTON1 }, + { "Button2", fltk::BUTTON2 }, + { "Button3", fltk::BUTTON3 } +};
What about Meta, Hyper, Super, AltGr, and Modeshift? Or, more generally, Mod1 through Mod5? BTW, I know it was like this before too, but something to think about for later is that this section could probably be replaced by a table instead of a bunch of if/else statements.
+ if ((Keys::isPressed("hide-panels")) && (get_panelmode() == UI_TEMPORARILY_SHOW_PANELS)) { + set_panelmode(UI_HIDDEN); + ret = 1; + } else if (Keys::isPressed("bookmarks")) { + a_UIcmd_book(a_UIcmd_get_bw_by_widget(this)); + ret = 1; + } else if (Keys::isPressed("find")) { + set_findbar_visibility(1); + ret = 1; + } else if (Keys::isPressed("goto")) { ... + } else if (Keys::isPressed("back")) { + a_UIcmd_back(a_UIcmd_get_bw_by_widget(this)); + ret = 1; + } else if (Keys::isPressed("forward")) { + a_UIcmd_forw(a_UIcmd_get_bw_by_widget(this)); + ret = 1; }
And, if you want to have an easier time keeping the formatting consistent, try this in your vimrc: " show tabs and trailing spaces set listchars=tab:>-,trail:- set list It's a minor thing really, but I noticed some inconsistent whitespace, and those config lines make it really easy to spot. :) -- Scott