private void KeyDown(object sender, KeyboardKeyEventArgs e) { anyDownedKeys.Add(e.Key, pool); downedKeys.Add(e.Key, pool); //Unfortunately, backspace isn't reported by keypress, so we do it manually. if (e.Key == Key.BackSpace) { TypedCharacters.Add('\b', pool); } }
private void KeyDown(object sender, KeyboardKeyEventArgs e) { anyDownedKeys.Add(e.Key, new PassthroughArrayPool <Key>(), new PassthroughArrayPool <int>()); downedKeys.Add(e.Key, new PassthroughArrayPool <Key>(), new PassthroughArrayPool <int>()); //Unfortunately, backspace isn't reported by keypress, so we do it manually. if (e.Key == Key.BackSpace) { TypedCharacters.Add('\b', new PassthroughArrayPool <char>()); } }
public void End() { anyDownedKeys.Clear(); anyDownedButtons.Clear(); previousDownedKeys.Clear(); previousDownedButtons.Clear(); for (int i = 0; i < downedKeys.Count; ++i) { previousDownedKeys.Add(downedKeys[i], pool); } for (int i = 0; i < downedButtons.Count; ++i) { previousDownedButtons.Add(downedButtons[i], pool); } ScrolledDown = 0; ScrolledUp = 0; TypedCharacters.Count = 0; }
public void End() { anyDownedKeys.Clear(); anyDownedButtons.Clear(); previousDownedKeys.Clear(); previousDownedButtons.Clear(); var keyPool = new PassthroughArrayPool <Key>(); var mouseButtonPool = new PassthroughArrayPool <MouseButton>(); var intPool = new PassthroughArrayPool <int>(); for (int i = 0; i < downedKeys.Count; ++i) { previousDownedKeys.Add(downedKeys[i], keyPool, intPool); } for (int i = 0; i < downedButtons.Count; ++i) { previousDownedButtons.Add(downedButtons[i], mouseButtonPool, intPool); } ScrolledDown = 0; ScrolledUp = 0; }
static void ProcessJSON(JSON control) { KeySet keys = null; // Get the keys if (control["input"].ContainsKey("key")) { keys = new KeySet(control["input"]["key"]); } if (control["input"].ContainsKey("pwd")) { Key key = new Key(); key.Add("kty", "oct"); key.Add("k", Message.base64urlencode(UTF8Encoding.UTF8.GetBytes(control["input"]["pwd"].AsString()))); keys = new KeySet(); keys.Add(key); } if (keys == null) { Console.WriteLine("No keys found"); return; } // // Check that we can validate each of these items // // Start with compact if (control["output"].ContainsKey("compact")) { Console.WriteLine(" Compact"); for (int i = 0; i < keys.Count; i++) { Message msg = Message.DecodeFromString(control["output"]["compact"].AsString()); CheckMessage(msg, keys[i], control["input"]); } // // Build a new version of the message // BuildCompact(control, keys); } if (control["output"].ContainsKey("json")) { Console.WriteLine(" Full"); for (int i = 0; i < keys.Count; i++) { Message msg = Message.DecodeFromJSON(control["output"]["json"]); CheckMessage(msg, keys[i], control["input"]); } } if (control["output"].ContainsKey("json_flat")) { Console.WriteLine(" Flat"); for (int i = 0; i < keys.Count; i++) { Message msg = Message.DecodeFromJSON(control["output"]["json_flat"]); CheckMessage(msg, keys[i], control["input"]); } } }
private void KeyDown(object sender, KeyboardKeyEventArgs e) { anyDownedKeys.Add(e.Key, new PassthroughArrayPool <Key>(), new PassthroughArrayPool <int>()); downedKeys.Add(e.Key, new PassthroughArrayPool <Key>(), new PassthroughArrayPool <int>()); }
public void Add(TKey key, TValue value) { m_KeySet.Add(key); key.value = value; }