Replace or explain "<fd-##>" and "<ff-##>" sequences #100

dbarnett opened this Issue Nov 25, 2012 · 2 comments


None yet
3 participants

Some solutions on vimgolf contain key sequences like <ff-58> and <fd-35> (see this Stack Overflow question: There's very little info anywhere on the internet about what that means.

If those are totally inert, vimgolf should filter them out of solutions so it's not confusing. If they're not totally inert and filtering them isn't an option, there should be some title text or link on vimgolf explaining what's going on.


urticadioica commented Dec 5, 2012

VimGolf uses vim -w to record keystrokes. Most keys are ASCII characters, either printing or control characters. Those are inserted directly into the keylog. There are some other characters that aren't represented by a simple ASCII character, and instead use a 3-character code, with the form 0x80, 0xXX, 0xXX. Whatever is in the last two bytes determines which key is being recorded. You can find a complete list in the VimGolf gem, at lib/vimgolf/keylog.rb.

The list includes just about everything, including the keys that show up as gobbledygook on the site. Most of the 3-character sequences show up right, but a few of them don't. Since they're all in the source file I mentioned, I've long assumed it was a server-side issue.

There are 3 sequences in particular that don't show up right on the site, but are tactically critical, that is, you often can't get perfect scores without them. Those are C-Home, C-End, and C-@. Note that C-@ isn't even a cursor key, and it's very useful in day-to-day Vim.

In addition, a lot of entries use C-Left and C-Right, which don't show up right, but they can be replaced by S-Left and S-Right for tactically the same effect.

Now that I think about it, it's rather suspicious that the only keys that show up wrong are those where at least one of the two bytes isn't ASCII, while all the keys that use only ASCII after 0x80 show up right.


igrigorik commented Jun 23, 2013

(please reopen if still relevant)

igrigorik closed this Jun 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment