/// ****************************************************************************
/// @file   
/// @author Dr.Neeton
/// @date   200X/X/X - 2014/02/05
/// 
/// @brief  キーボード管理
/// 
/// ****************************************************************************

#pragma once

#include "../GUI/Container/CPL_WIN_Component.h"


namespace CPL {
namespace WIN {

  
// _____________________________________________________________________________
/// @brief キーボード管理クラス
///
// *****************************************************************************
class Keyboard {
  friend class Component;
private:
  static bool  m_fVKey[ 256 ];

public:
  Keyboard()
  {
    ::memset( m_fVKey, 0, sizeof(m_fVKey) );
  }
  static bool A(){ return m_fVKey[ (int)'A' ]; }
  static bool B(){ return m_fVKey[ (int)'B' ]; }
  static bool C(){ return m_fVKey[ (int)'C' ]; }
  static bool D(){ return m_fVKey[ (int)'D' ]; }
  static bool E(){ return m_fVKey[ (int)'E' ]; }
  static bool F(){ return m_fVKey[ (int)'F' ]; }
  static bool G(){ return m_fVKey[ (int)'G' ]; }
  static bool H(){ return m_fVKey[ (int)'H' ]; }
  static bool I(){ return m_fVKey[ (int)'I' ]; }
  static bool J(){ return m_fVKey[ (int)'J' ]; }
  static bool K(){ return m_fVKey[ (int)'K' ]; }
  static bool L(){ return m_fVKey[ (int)'L' ]; }
  static bool M(){ return m_fVKey[ (int)'M' ]; }
  static bool N(){ return m_fVKey[ (int)'N' ]; }
  static bool O(){ return m_fVKey[ (int)'O' ]; }
  static bool P(){ return m_fVKey[ (int)'P' ]; }
  static bool Q(){ return m_fVKey[ (int)'Q' ]; }
  static bool R(){ return m_fVKey[ (int)'R' ]; }
  static bool S(){ return m_fVKey[ (int)'S' ]; }
  static bool T(){ return m_fVKey[ (int)'T' ]; }
  static bool U(){ return m_fVKey[ (int)'U' ]; }
  static bool V(){ return m_fVKey[ (int)'V' ]; }
  static bool W(){ return m_fVKey[ (int)'W' ]; }
  static bool X(){ return m_fVKey[ (int)'X' ]; }
  static bool Y(){ return m_fVKey[ (int)'Y' ]; }
  static bool Z(){ return m_fVKey[ (int)'Z' ]; }

  static bool Back()      { return m_fVKey[ VK_BACK       ]; }
  static bool Tab()       { return m_fVKey[ VK_TAB        ]; }
  static bool Clear()     { return m_fVKey[ VK_CLEAR      ]; }
  static bool Return()    { return m_fVKey[ VK_RETURN     ]; }
  static bool Shift()     { return m_fVKey[ VK_SHIFT      ]; }
  static bool Control()   { return m_fVKey[ VK_CONTROL    ]; }
  static bool Menu()      { return m_fVKey[ VK_MENU       ]; }
  static bool Pause()     { return m_fVKey[ VK_PAUSE      ]; }
  static bool Capital()   { return m_fVKey[ VK_CAPITAL    ]; }
  static bool Kana()      { return m_fVKey[ VK_KANA       ]; }
  static bool Hangeul()   { return m_fVKey[ VK_HANGEUL    ]; }
  static bool Hangul()    { return m_fVKey[ VK_HANGUL     ]; }
  static bool Junja()     { return m_fVKey[ VK_JUNJA      ]; }
  static bool Final()     { return m_fVKey[ VK_FINAL      ]; }
  static bool Hanja()     { return m_fVKey[ VK_HANJA      ]; }
  static bool Kanji()     { return m_fVKey[ VK_KANJI      ]; }
  static bool Escape()    { return m_fVKey[ VK_ESCAPE     ]; }
  static bool Convert()   { return m_fVKey[ VK_CONVERT    ]; }
  static bool NonConvert(){ return m_fVKey[ VK_NONCONVERT ]; }
  static bool Accept()    { return m_fVKey[ VK_ACCEPT     ]; }
  static bool ModeChange(){ return m_fVKey[ VK_MODECHANGE ]; }

  static bool Space()     { return m_fVKey[ VK_SPACE      ]; }
  static bool Prior()     { return m_fVKey[ VK_PRIOR      ]; }
  static bool Next()      { return m_fVKey[ VK_NEXT       ]; }
  static bool End()       { return m_fVKey[ VK_END        ]; }
  static bool Home()      { return m_fVKey[ VK_HOME       ]; }
  static bool Left()      { return m_fVKey[ VK_LEFT       ]; }
  static bool Up()        { return m_fVKey[ VK_UP         ]; }
  static bool Right()     { return m_fVKey[ VK_RIGHT      ]; }
  static bool Down()      { return m_fVKey[ VK_DOWN       ]; }
  static bool Select()    { return m_fVKey[ VK_SELECT     ]; }
  static bool Print()     { return m_fVKey[ VK_PRINT      ]; }
  static bool Execute()   { return m_fVKey[ VK_EXECUTE    ]; }
  static bool Snapshot()  { return m_fVKey[ VK_SNAPSHOT   ]; }
  static bool Insert()    { return m_fVKey[ VK_INSERT     ]; }
  static bool Delete()    { return m_fVKey[ VK_DELETE     ]; }
  static bool Help()      { return m_fVKey[ VK_HELP       ]; }
  
  static bool LWin()      { return m_fVKey[ VK_LWIN       ]; }
  static bool RWin()      { return m_fVKey[ VK_RWIN       ]; }
  static bool Arps()      { return m_fVKey[ VK_APPS       ]; }
  static bool Sleep()     { return m_fVKey[ VK_SLEEP      ]; }

  static bool NumPad0()   { return m_fVKey[ VK_NUMPAD0    ]; }
  static bool NumPad1()   { return m_fVKey[ VK_NUMPAD1    ]; }
  static bool NumPad2()   { return m_fVKey[ VK_NUMPAD2    ]; }
  static bool NumPad3()   { return m_fVKey[ VK_NUMPAD3    ]; }
  static bool NumPad4()   { return m_fVKey[ VK_NUMPAD4    ]; }
  static bool NumPad5()   { return m_fVKey[ VK_NUMPAD5    ]; }
  static bool NumPad6()   { return m_fVKey[ VK_NUMPAD6    ]; }
  static bool NumPad7()   { return m_fVKey[ VK_NUMPAD7    ]; }
  static bool NumPad8()   { return m_fVKey[ VK_NUMPAD8    ]; }
  static bool NumPad9()   { return m_fVKey[ VK_NUMPAD9    ]; }
  static bool Multiply()  { return m_fVKey[ VK_MULTIPLY   ]; }
  static bool Add()       { return m_fVKey[ VK_ADD        ]; }
  static bool Separator() { return m_fVKey[ VK_SEPARATOR  ]; }
  static bool Subtract()  { return m_fVKey[ VK_SUBTRACT   ]; }
  static bool Decimal()   { return m_fVKey[ VK_DECIMAL    ]; }
  static bool Divide()    { return m_fVKey[ VK_DIVIDE     ]; }
  static bool F1()        { return m_fVKey[ VK_F1         ]; }
  static bool F2()        { return m_fVKey[ VK_F2         ]; }
  static bool F3()        { return m_fVKey[ VK_F3         ]; }
  static bool F4()        { return m_fVKey[ VK_F4         ]; }
  static bool F5()        { return m_fVKey[ VK_F5         ]; }
  static bool F6()        { return m_fVKey[ VK_F6         ]; }
  static bool F7()        { return m_fVKey[ VK_F7         ]; }
  static bool F8()        { return m_fVKey[ VK_F8         ]; }
  static bool F9()        { return m_fVKey[ VK_F9         ]; }
  static bool F10()       { return m_fVKey[ VK_F10        ]; }
  static bool F11()       { return m_fVKey[ VK_F11        ]; }
  static bool F12()       { return m_fVKey[ VK_F12        ]; }
  static bool F13()       { return m_fVKey[ VK_F13        ]; }
  static bool F14()       { return m_fVKey[ VK_F14        ]; }
  static bool F15()       { return m_fVKey[ VK_F15        ]; }
  static bool F16()       { return m_fVKey[ VK_F16        ]; }
  static bool F17()       { return m_fVKey[ VK_F17        ]; }
  static bool F18()       { return m_fVKey[ VK_F18        ]; }
  static bool F19()       { return m_fVKey[ VK_F19        ]; }
  static bool F20()       { return m_fVKey[ VK_F20        ]; }
  static bool F21()       { return m_fVKey[ VK_F21        ]; }
  static bool F22()       { return m_fVKey[ VK_F22        ]; }
  static bool F23()       { return m_fVKey[ VK_F23        ]; }
  static bool F24()       { return m_fVKey[ VK_F24        ]; }
  static bool NumLock()   { return m_fVKey[ VK_NUMLOCK    ]; }
  static bool Scroll()    { return m_fVKey[ VK_SCROLL     ]; }

  static bool OemNexEqual() { return m_fVKey[ VK_OEM_NEC_EQUAL  ]; } // '=' key on numpad
  static bool OemFjJisho()  { return m_fVKey[ VK_OEM_FJ_JISHO   ]; } // 'Dictionary' key
  static bool OemFjMasshou(){ return m_fVKey[ VK_OEM_FJ_MASSHOU ]; } // 'Unregister word' key
  static bool OemFjTouroku(){ return m_fVKey[ VK_OEM_FJ_TOUROKU ]; } // 'Register word' key
  static bool OemFjLoya()   { return m_fVKey[ VK_OEM_FJ_LOYA    ]; } // 'Left OYAYUBI' key
  static bool OemFjRoya()   { return m_fVKey[ VK_OEM_FJ_ROYA    ]; } // 'Right OYAYUBI' key
  
  static bool LShift()    { return m_fVKey[ VK_LSHIFT     ]; }
  static bool RShift()    { return m_fVKey[ VK_RSHIFT     ]; }
  static bool LControl()  { return m_fVKey[ VK_LCONTROL   ]; }
  static bool RControl()  { return m_fVKey[ VK_RCONTROL   ]; }
  static bool LMenu()     { return m_fVKey[ VK_LMENU      ]; }
  static bool RMenu()     { return m_fVKey[ VK_RMENU      ]; }
#if(_WIN32_WINNT >= 0x0500)
  static bool BrowserBack()      { return m_fVKey[ VK_BROWSER_BACK         ]; }
  static bool BrowserForward()   { return m_fVKey[ VK_BROWSER_FORWARD      ]; }
  static bool BrowserRefresh()   { return m_fVKey[ VK_BROWSER_REFRESH      ]; }
  static bool BrowserStop()      { return m_fVKey[ VK_BROWSER_STOP         ]; }
  static bool BrowserFind()    { return m_fVKey[ VK_BROWSER_SEARCH       ]; }
  static bool BrowserFavorites() { return m_fVKey[ VK_BROWSER_FAVORITES    ]; }
  static bool BrowserHome()      { return m_fVKey[ VK_BROWSER_HOME         ]; }
  static bool VolumeMute()       { return m_fVKey[ VK_VOLUME_MUTE          ]; }
  static bool VolumeDown()       { return m_fVKey[ VK_VOLUME_DOWN          ]; }
  static bool VolumeUp()         { return m_fVKey[ VK_VOLUME_UP            ]; }
  static bool MediaNextTrack()   { return m_fVKey[ VK_MEDIA_NEXT_TRACK     ]; }
  static bool MediaPrevTrack()   { return m_fVKey[ VK_MEDIA_PREV_TRACK     ]; }
  static bool MediaStop()        { return m_fVKey[ VK_MEDIA_STOP           ]; }
  static bool MediaPlayPause()   { return m_fVKey[ VK_MEDIA_PLAY_PAUSE     ]; }
  static bool LaunchMail()       { return m_fVKey[ VK_LAUNCH_MAIL          ]; }
  static bool LaunchMediaSelect(){ return m_fVKey[ VK_LAUNCH_MEDIA_SELECT  ]; }
  static bool LaunchApp1()       { return m_fVKey[ VK_LAUNCH_APP1          ]; }
  static bool LaunchApp2()       { return m_fVKey[ VK_LAUNCH_APP2          ]; }
#endif /* _WIN32_WINNT >= 0x0500 */

  static bool Oem1()      { return m_fVKey[ VK_OEM_1      ]; } // ';:' for US
  static bool OemPlus()   { return m_fVKey[ VK_OEM_PLUS   ]; } // '+' any country
  static bool OemComma()  { return m_fVKey[ VK_OEM_COMMA  ]; } // ',' any country
  static bool OemMinus()  { return m_fVKey[ VK_OEM_MINUS  ]; } // '-' any country
  static bool OemPeriod() { return m_fVKey[ VK_OEM_PERIOD ]; } // '.' any country
  static bool Oem2()      { return m_fVKey[ VK_OEM_2      ]; } // '/?' for US
  static bool Oem3()      { return m_fVKey[ VK_OEM_3      ]; } // '`~' for US
  static bool Oem4()      { return m_fVKey[ VK_OEM_4      ]; } //  '[{' for US
  static bool Oem5()      { return m_fVKey[ VK_OEM_5      ]; } //  '\|' for US
  static bool Oem6()      { return m_fVKey[ VK_OEM_6      ]; } //  ']}' for US
  static bool Oem7()      { return m_fVKey[ VK_OEM_7      ]; } //  ''"' for US
  static bool Oem8()      { return m_fVKey[ VK_OEM_8      ]; }
  static bool OemAx()     { return m_fVKey[ VK_OEM_AX     ]; } //  'AX' key on Japanese AX kbd
  static bool Oem102()    { return m_fVKey[ VK_OEM_102    ]; } //  "<>" or "\|" on RT 102-key kbd.
  static bool IcoHelp()   { return m_fVKey[ VK_ICO_HELP   ]; } //  Help key on ICO
  static bool Ico00()     { return m_fVKey[ VK_ICO_00     ]; } //  00 key on ICO
#if(WINVER >= 0x0400)
  static bool ProcessKey(){ return m_fVKey[ VK_PROCESSKEY ]; }
#endif /* WINVER >= 0x0400 */
  static bool IcoClear()  { return m_fVKey[ VK_ICO_CLEAR  ]; }
#if(_WIN32_WINNT >= 0x0500)
  static bool Packet()    { return m_fVKey[ VK_PACKET     ]; }
#endif /* _WIN32_WINNT >= 0x0500 */
  static bool OemReset()  { return m_fVKey[ VK_OEM_RESET   ]; }
  static bool OemJump()   { return m_fVKey[ VK_OEM_JUMP    ]; }
  static bool OemPa1()    { return m_fVKey[ VK_OEM_PA1     ]; }
  static bool OemPa2()    { return m_fVKey[ VK_OEM_PA2     ]; }
  static bool OemPa3()    { return m_fVKey[ VK_OEM_PA3     ]; }
  static bool OemWsctrl() { return m_fVKey[ VK_OEM_WSCTRL  ]; }
  static bool OemCusel()  { return m_fVKey[ VK_OEM_CUSEL   ]; }
  static bool OemAttn()   { return m_fVKey[ VK_OEM_ATTN    ]; }
  static bool OemFinish() { return m_fVKey[ VK_OEM_FINISH  ]; }
  static bool OemCopy()   { return m_fVKey[ VK_OEM_COPY    ]; }
  static bool OemAuto()   { return m_fVKey[ VK_OEM_AUTO    ]; }
  static bool OemEnlw()   { return m_fVKey[ VK_OEM_ENLW    ]; }
  static bool OemBacktab(){ return m_fVKey[ VK_OEM_BACKTAB ]; }
  static bool Attn()      { return m_fVKey[ VK_ATTN        ]; }
  static bool Crsel()     { return m_fVKey[ VK_CRSEL       ]; }
  static bool Exsel()     { return m_fVKey[ VK_EXSEL       ]; }
  static bool Ereof()     { return m_fVKey[ VK_EREOF       ]; }
  static bool Play()      { return m_fVKey[ VK_PLAY        ]; }
  static bool Zoom()      { return m_fVKey[ VK_ZOOM        ]; }
  static bool Noname()    { return m_fVKey[ VK_NONAME      ]; }
  static bool Pa1()       { return m_fVKey[ VK_PA1         ]; }
  static bool OemClear()  { return m_fVKey[ VK_OEM_CLEAR   ]; }
};


} // namespace WIN
} // namespace CPL
