using System;
using System.Collections.Generic;
using System.Text;
using Vortex.Input;

namespace Vortex.SceneFramework {

	/// <summary>Defines keyboarsd event callback handler for domain graph</summary>
	public delegate void KeyboardGraphEventHandler(Node sender, KeyboardEventInfo eventInfo);
	
	/// <summary>
	/// Implements keyboard input event information
	/// </summary>
	public class KeyboardEventInfo : InputEventInfo {
		private VirtualKey _key;
		private char _char;

		/// <summary>
		/// Initializes a new instance of the <see cref="KeyboardEventInfo"/> class.
		/// </summary>
		/// <param name="eventTarget">The event target element.</param>
		/// <param name="key">The key being triggered.</param>
		/// <param name="keyStates">The key states at the moment of event.</param>
		public KeyboardEventInfo(Node eventTarget, VirtualKey key, KeyStates keyStates)
			: base(eventTarget, keyStates) {
			_key = key;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="KeyboardEventInfo"/> class.
		/// </summary>
		/// <param name="eventTarget">The event target element.</param>
		/// <param name="key">The key being triggered.</param>
		/// <param name="keyStates">The key states at the moment of event.</param>
		public KeyboardEventInfo(Node eventTarget, char charCode, KeyStates keyStates)
			: base(eventTarget, keyStates) {
			_char = charCode;
		}

		/// <summary>
		/// Gets the key being triggered with this event.
		/// </summary>
		/// <value>The key of this event.</value>
		public VirtualKey Key {
			get { return _key; }
		}

		/// <summary>
		/// Gets the char encoded by system for this event.
		/// </summary>
		/// <value>The input char code.</value>
		public char Char {
			get { return _char; }
		}
	}
}
