Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# KeyboardKey.cpp

Go to the documentation of this file.

    00001 //------------------------------------------------------------------------------
    00002 // Lamp : Open source game middleware
    00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
    00004 //
    00005 // This library is free software; you can redistribute it and/or
    00006 // modify it under the terms of the GNU Lesser General Public
    00007 // License as published by the Free Software Foundation; either
    00008 // version 2.1 of the License, or (at your option) any later version.
    00009 //
    00010 // This library is distributed in the hope that it will be useful,
    00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 // Lesser General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU Lesser General Public
    00016 // License along with this library; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 //------------------------------------------------------------------------------
    00019
    00020 /** @file
    00021  * キーボードキー実装
    00022  * @author Junpee
    00023  */
    00024
    00025 #include "LampBasic.h"
    00026 #include "Input/Keyboard/KeyboardKey.h"
    00027
    00028 namespace Lamp{
    00029
    00030 // キー名
    00031 String KeyboardKey::keyName_[maxKeyCount];
    00032 // 初期化フラグ
    00033 bool KeyboardKey::initialized_ = false;
    00034
    00035 //------------------------------------------------------------------------------
    00036 // キー文字列初期化
    00037 void KeyboardKey::initializeKeyString(){
    00038     if(initialized_){ return; }
    00039     String unknown("UnknownKey");
    00040     for(int i = 0; i < maxKeyCount; i++){ keyName_[i] = unknown; }
    00041     keyName_[keyEscape] = "Escape";
    00042     keyName_[key1] = "1";
    00043     keyName_[key2] = "2";
    00044     keyName_[key3] = "3";
    00045     keyName_[key4] = "4";
    00046     keyName_[key5] = "5";
    00047     keyName_[key6] = "6";
    00048     keyName_[key7] = "7";
    00049     keyName_[key8] = "8";
    00050     keyName_[key9] = "9";
    00051     keyName_[key0] = "0";
    00052     keyName_[keyMinus] = "Minus";
    00053     keyName_[keyEquals] = "Equals";
    00054     keyName_[keyBackspace] = "Backspace";
    00055     keyName_[keyTab] = "Tab";
    00056     keyName_[keyQ] = "Q";
    00057     keyName_[keyW] = "W";
    00058     keyName_[keyE] = "E";
    00059     keyName_[keyR] = "R";
    00060     keyName_[keyT] = "T";
    00061     keyName_[keyY] = "Y";
    00062     keyName_[keyU] = "U";
    00063     keyName_[keyI] = "I";
    00064     keyName_[keyO] = "O";
    00065     keyName_[keyP] = "P";
    00066     keyName_[keyLeftBracket] = "LeftBracket";
    00067     keyName_[keyRightBracket] = "RightBracket";
    00068     keyName_[keyEnter] = "Enter";
    00069     keyName_[keyLeftControl] = "LeftControl";
    00070     keyName_[keyA] = "A";
    00071     keyName_[keyS] = "S";
    00072     keyName_[keyD] = "D";
    00073     keyName_[keyF] = "F";
    00074     keyName_[keyG] = "G";
    00075     keyName_[keyH] = "H";
    00076     keyName_[keyJ] = "J";
    00077     keyName_[keyK] = "K";
    00078     keyName_[keyL] = "L";
    00079     keyName_[keySemicolon] = "Semicolon";
    00080     keyName_[keyApostrophe] = "Apostrophe";
    00081     keyName_[keyGrave] = "Grave";
    00082     keyName_[keyLeftShift] = "LeftShift";
    00083     keyName_[keyBackslash] = "Backslash";
    00084     keyName_[keyZ] = "Z";
    00085     keyName_[keyX] = "X";
    00086     keyName_[keyC] = "C";
    00087     keyName_[keyV] = "V";
    00088     keyName_[keyB] = "B";
    00089     keyName_[keyN] = "N";
    00090     keyName_[keyM] = "M";
    00091     keyName_[keyComma] = "Comma";
    00092     keyName_[keyPeriod] = "Period";
    00093     keyName_[keySlash] = "Slash";
    00094     keyName_[keyRightShift] = "RightShift";
    00095     keyName_[keyNumPadMultiply] = "NumPadMultiply";
    00096     keyName_[keyLeftAlt] = "LeftAlt";
    00097     keyName_[keySpace] = "Space";
    00098     keyName_[keyCapsLock] = "CapsLock";
    00099     keyName_[keyF1] = "F1";
    00100     keyName_[keyF2] = "F2";
    00101     keyName_[keyF3] = "F3";
    00102     keyName_[keyF4] = "F4";
    00103     keyName_[keyF5] = "F5";
    00104     keyName_[keyF6] = "F6";
    00105     keyName_[keyF7] = "F7";
    00106     keyName_[keyF8] = "F8";
    00107     keyName_[keyF9] = "F9";
    00108     keyName_[keyF10] = "F10";
    00109     keyName_[keyNumLock] = "NumLock";
    00110     keyName_[keyScroll] = "Scroll";
    00111     keyName_[keyNumPad7] = "NumPad7";
    00112     keyName_[keyNumPad8] = "NumPad8";
    00113     keyName_[keyNumPad9] = "NumPad9";
    00114     keyName_[keyNumPadSubtract] = "NumPadSubtract";
    00115     keyName_[keyNumPad4] = "NumPad4";
    00116     keyName_[keyNumPad5] = "NumPad5";
    00117     keyName_[keyNumPad6] = "NumPad6";
    00118     keyName_[keyNumPadAdd] = "NumPadAdd";
    00119     keyName_[keyNumPad1] = "NumPad1";
    00120     keyName_[keyNumPad2] = "NumPad2";
    00121     keyName_[keyNumPad3] = "NumPad3";
    00122     keyName_[keyNumPad0] = "NumPad0";
    00123     keyName_[keyNumPadDecimal] = "NumPadDecimal";
    00124     keyName_[keyLeftBackslash] = "LeftBackslash";
    00125     keyName_[keyF11] = "F11";
    00126     keyName_[keyF12] = "F12";
    00127     keyName_[keyF13] = "F13";
    00128     keyName_[keyF14] = "F14";
    00129     keyName_[keyF15] = "F15";
    00130     keyName_[keyKana] = "Kana";
    00131     keyName_[keyAbntC1] = "AbntC1";
    00132     keyName_[keyConvert] = "Convert";
    00133     keyName_[keyNoConvert] = "NoConvert";
    00134     keyName_[keyYen] = "Yen";
    00135     keyName_[keyNumPadAbntC2] = "NumPadAbntC2";
    00136     keyName_[keyNumPadEquals98] = "NumPadEquals98";
    00137     keyName_[keyPrevTrack] = "PrevTrack";
    00138     keyName_[keyAtmark] = "Atmark";
    00139     keyName_[keyColon] = "Colon";
    00140     keyName_[keyUnderLine98] = "UnderLine98";
    00141     keyName_[keyKanji] = "Kanji";
    00142     keyName_[keyStop98] = "Stop98";
    00143     keyName_[keyAx] = "Ax";
    00144     keyName_[keyUnlabeled] = "Unlabeled";
    00145     keyName_[keyNextTrack] = "NextTrack";
    00146     keyName_[keyNumPadEnter] = "NumPadEnter";
    00147     keyName_[keyRightControl] = "RightControl";
    00148     keyName_[keyMute] = "Mute";
    00149     keyName_[keyCalculator] = "Calculator";
    00150     keyName_[keyPlayPause] = "PlayPause";
    00151     keyName_[keyMediaStop] = "MediaStop";
    00152     keyName_[keyVolumeDown] = "VolumeDown";
    00153     keyName_[keyVolumeUp] = "VolumeUp";
    00154     keyName_[keyWebHome] = "WebHome";
    00155     keyName_[keyNumPadComma] = "NumPadComma";
    00156     keyName_[keyNumPadDivide] = "NumPadDivide";
    00157     keyName_[keyPrintScreen] = "PrintScreen";
    00158     keyName_[keyRightAlt] = "RightAlt";
    00159     keyName_[keyPause] = "Pause";
    00160     keyName_[keyHome] = "Home";
    00161     keyName_[keyUp] = "Up";
    00162     keyName_[keyPageUp] = "PageUp";
    00163     keyName_[keyLeft] = "Left";
    00164     keyName_[keyRight] = "Right";
    00165     keyName_[keyEnd] = "End";
    00166     keyName_[keyDown] = "Down";
    00167     keyName_[keyPageDown] = "PageDown";
    00168     keyName_[keyInsert] = "Insert";
    00169     keyName_[keyDelete] = "Delete";
    00170     keyName_[keyLeftWin] = "LeftWin";
    00171     keyName_[keyRightWin] = "RightWin";
    00172     keyName_[keyApps] = "Apps";
    00173     keyName_[keyPower] = "Power";
    00174     keyName_[keySleep] = "Sleep";
    00175     keyName_[keyWake] = "Wake";
    00176     keyName_[keyWebSearch] = "WebSearch";
    00177     keyName_[keyWebFavorites] = "WebFavorites";
    00178     keyName_[keyWebRefresh] = "WebRefresh";
    00179     keyName_[keyWebStop] = "WebStop";
    00180     keyName_[keyWebForward] = "WebForward";
    00181     keyName_[keyWebBack] = "WebBack";
    00182     keyName_[keyMyComputer] = "MyComputer";
    00183     keyName_[keyMail] = "Mail";
    00184     keyName_[keyMediaSelect] = "MediaSelect";
    00185     initialized_ = true;
    00186 }
    00187 //------------------------------------------------------------------------------
    00188 } // End of namespace Lamp
    00189 //------------------------------------------------------------------------------