Skip to content

Commit 633433a

Browse files
committed
Comment on source of Key values
1 parent 9fa3469 commit 633433a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/bunit.web/EventDispatchExtensions/Key.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
namespace Bunit
22
{
3+
// Integer values are same as in Selenium Keys class. The Selenium Keys class provides values of strings with single characters.
4+
// These values are integer code of the characters in Selenium Keys class. Exceptions are Null and control keys (e.g. Shift, Alt, Control).
5+
// Principle is that control keys are encoded as bit flags in high 16 bits. Non-control key values must be in low 16 bits.
6+
// This way it is possible to combine special keys with control keys. E.g. Key.Enter | Key.Alt
37
/// <summary>
48
/// Special keys that can be dispatched in keyboard events.
59
/// </summary>

src/bunit.web/EventDispatchExtensions/KeysEventFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace Bunit
66
{
77
internal static class KeysEventFactory
88
{
9+
// Values were recorded using small Selenium application in Chrome browser.
910
private static readonly Dictionary<Key, (string Key, string Code)> KeyEvents = new Dictionary<Key, (string key, string code)>()
1011
{
1112
{ Key.Backspace, ("Backspace", "Backspace") },

0 commit comments

Comments
 (0)