indexing
	description: "Eiffel Vision key. Represents a virtual key code. `code' can be anyof the constant values defined in EV_KEY_CONSTANTS."
	status: "See notice at end of class"
	date: "$Date$"
	revision: "$Revision$"

class interface
	EV_KEY

create 

	default_create
			-- Initialize with Key_enter.

	make_with_code (a_code: INTEGER)
			-- Initialize with a_code.
		require
			a_code_valid: valid_key_code (a_code)

feature -- Access

	code: INTEGER
			-- Code representing some key.
	
feature -- Status report

	is_alpha: BOOLEAN
			-- Is code in ["a"-"z"]?

	is_arrow: BOOLEAN
			-- Is code an arrow key?

	is_function: BOOLEAN
			-- Is code a function key?

	is_number: BOOLEAN
			-- Is code in ["0"-"9"]?

	is_numpad: BOOLEAN
			-- Is code a key on the numpad?
	
feature -- Element change

	set_code (a_code: INTEGER)
			-- Assign a_code to code.
		require
			a_code_valid: valid_key_code (a_code)
		ensure
			code_assigned: code = a_code
	
feature  -- Contract support

	valid_key_code (a_code: INTEGER): BOOLEAN
			-- Is `a_code' a valid key code?
			-- (from EV_KEY_CONSTANTS)
	
feature -- Standard output

	out: STRING
			-- Readable representation of code.
	
invariant

	code_valid: valid_key_code (code)
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class EV_KEY