class interface ACCELERATOR

creation
   make
      --  Reset control keys.


feature(s) from ACCELERATOR
   --  Status

   has_alt: BOOLEAN
      --  Associated shortcut keys.


feature(s) from ACCELERATOR
   --  Status

   has_control: BOOLEAN
      --  Associated shortcut keys.


feature(s) from ACCELERATOR
   --  Status

   has_shift: BOOLEAN
      --  Associated shortcut keys.


feature(s) from ACCELERATOR
   --  Status

   is_key: BOOLEAN
      --  Is this accelerator based on a virtual key?

      ensure
         coherent: Result = not is_character

   is_character: BOOLEAN
      --  Is this accelerator based on a character code?

      ensure
         coherent: Result = not is_key

feature(s) from ACCELERATOR
   --  Update

   make
      --  Reset control keys.


feature(s) from ACCELERATOR
   --  Update

   reset
      --  Reset control keys.


   set_alt
      --  Add ALT key to shortcut.

      ensure
         ok: has_alt

   set_control
      --  Add CONTROL key to shortcut.

      ensure
         ok: has_control

   set_shift
      --  Add SHIFT key to shortcut.

      ensure
         ok: has_shift

   set_character (ch: CHARACTER)
      --  Associate character with keyboard shortcut.
      --  (this cancels the associated vkey if any).

      require
         case_sensitive:  --  character based accelerator is case sensitive
      ensure
         registered: char = ch;
         is_char_accel: is_key

   set_virtual_key (vk: VIRTUAL_KEY)
      --  Associate virtual key with keyboard shortcut.
      --  (this cancels the associated character if any).

      require
         ok: vk /= Void
      ensure
         keep_reference: vkey = vk;
         is_vk_accel: is_key


end of ACCELERATOR