Use constants for keyCodes #1241

Closed
tvoliter opened this Issue Jul 12, 2012 · 8 comments

5 participants

@tvoliter

Most of Brackets code that looks at the keyCode member of an event compares it against the keyCode number. Brackets could would be more readable if keycode constants were used instead.

References regarding constants and keyCodes
http://www.javascripter.net/faq/keyeventconstantsfirefox.htm
http://stackoverflow.com/questions/1465374/javascript-event-keycode-constants

@peterflynn
Adobe Systems Incorporated member

There's more of this in the unit tests now too... see the tests added by pull #1273, for example.

@couzteau
Adobe Systems Incorporated member

Hi brackets people. Looking into fixing this issue- Jochen

@couzteau
Adobe Systems Incorporated member

This is an easy fix but I wonder what the preferred place to define key constants would be. Do you want them in utils.Globals.js?

@couzteau
Adobe Systems Incorporated member

I suppose a better place might be to put constants into a KeyEvent class in utils? Thanks for a quick comment.

@redmunds

Joschen, Thanks for taking this on. I marked it as "Fix in Progress". Yes, I think a KeyEvent module in utils is perfect.

@couzteau
Adobe Systems Incorporated member

Pull request pending.

@jasonsanjose jasonsanjose was assigned Sep 12, 2012
@jasonsanjose
Adobe Systems Incorporated member

FBNC to @jasonsanjose

@jasonsanjose
Adobe Systems Incorporated member

Confirmed fixed by pull request #1583.

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