00001 // Filename: keyboardButton.h 00002 // Created by: drose (01Mar00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef KEYBOARDBUTTON_H 00016 #define KEYBOARDBUTTON_H 00017 00018 #include "pandabase.h" 00019 00020 #include "buttonHandle.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : KeyboardButton 00024 // Description : This class is just used as a convenient namespace for 00025 // grouping all of these handy functions that return 00026 // buttons which map to standard keyboard keys. 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDA_PUTIL KeyboardButton { 00029 PUBLISHED: 00030 static ButtonHandle ascii_key(char ascii_equivalent); 00031 static ButtonHandle ascii_key(const string &ascii_equivalent); 00032 00033 static ButtonHandle space(); 00034 static ButtonHandle backspace(); 00035 static ButtonHandle tab(); 00036 static ButtonHandle enter(); 00037 static ButtonHandle escape(); 00038 00039 static ButtonHandle f1(); 00040 static ButtonHandle f2(); 00041 static ButtonHandle f3(); 00042 static ButtonHandle f4(); 00043 static ButtonHandle f5(); 00044 static ButtonHandle f6(); 00045 static ButtonHandle f7(); 00046 static ButtonHandle f8(); 00047 static ButtonHandle f9(); 00048 static ButtonHandle f10(); 00049 static ButtonHandle f11(); 00050 static ButtonHandle f12(); 00051 00052 // PC keyboards don't have these four buttons, but Macs do. 00053 static ButtonHandle f13(); 00054 static ButtonHandle f14(); 00055 static ButtonHandle f15(); 00056 static ButtonHandle f16(); 00057 00058 static ButtonHandle left(); 00059 static ButtonHandle right(); 00060 static ButtonHandle up(); 00061 static ButtonHandle down(); 00062 static ButtonHandle page_up(); 00063 static ButtonHandle page_down(); 00064 static ButtonHandle home(); 00065 static ButtonHandle end(); 00066 static ButtonHandle insert(); 00067 static ButtonHandle del(); // delete is a C++ keyword. 00068 static ButtonHandle help(); 00069 00070 static ButtonHandle shift(); 00071 static ButtonHandle control(); 00072 static ButtonHandle alt(); 00073 static ButtonHandle meta(); 00074 static ButtonHandle caps_lock(); 00075 static ButtonHandle shift_lock(); 00076 static ButtonHandle num_lock(); 00077 static ButtonHandle scroll_lock(); 00078 static ButtonHandle print_screen(); 00079 static ButtonHandle pause(); 00080 00081 static ButtonHandle lshift(); 00082 static ButtonHandle rshift(); 00083 static ButtonHandle lcontrol(); 00084 static ButtonHandle rcontrol(); 00085 static ButtonHandle lalt(); 00086 static ButtonHandle ralt(); 00087 00088 public: 00089 static void init_keyboard_buttons(); 00090 }; 00091 00092 #endif