forked from sproutcore/sproutcore
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sproutcore#538 from oruen/keypress_with_equal_keyc…
…ode_and_charcode Keypress with equal keycode and charcode, refs sproutcore#83
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ========================================================================== | ||
// Project: SproutCore - JavaScript Application Framework | ||
// Copyright: ©2006-2011 Strobe Inc. and contributors. | ||
// ©2008-2011 Apple Inc. All rights reserved. | ||
// License: Licensed under MIT license (see license.js) | ||
// ========================================================================== | ||
|
||
// // ======================================================================== | ||
// SC.Event Tests | ||
// ======================================================================== | ||
(function () { | ||
module("SC.Event"); | ||
|
||
// WebKit browsers have equal values for keyCode and charCode on keypress event | ||
test("commandCodes() : should handle equal keyCode and charCode on keypress", function () { | ||
// 115 is alose keyCode for F4 button | ||
var codes = new SC.Event({ type: 'keypress', keyCode: 115, charCode: 115 }).commandCodes(); | ||
equals(codes[0], null, 'command'); | ||
equals(codes[1], 's', 'char'); | ||
}); | ||
})(); | ||
|