// ____ ______ __ // / __ \ / ____// / // / /_/ // / / / // / ____// /___ / /___ PixInsight Class Library // /_/ \____//_____/ PCL 2.4.23 // ---------------------------------------------------------------------------- // pcl/KeyCodes.h - Released 2022-03-12T18:59:29Z // ---------------------------------------------------------------------------- // This file is part of the PixInsight Class Library (PCL). // PCL is a multiplatform C++ framework for development of PixInsight modules. // // Copyright (c) 2003-2022 Pleiades Astrophoto S.L. All Rights Reserved. // // Redistribution and use in both source and binary forms, with or without // modification, is permitted provided that the following conditions are met: // // 1. All redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. All redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names // of their contributors, may be used to endorse or promote products derived // from this software without specific prior written permission. For written // permission, please contact info@pixinsight.com. // // 4. All products derived from this software, in any form whatsoever, must // reproduce the following acknowledgment in the end-user documentation // and/or other materials provided with the product: // // "This product is based on software from the PixInsight project, developed // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)." // // Alternatively, if that is where third-party acknowledgments normally // appear, this acknowledgment must be reproduced in the product itself. // // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE, // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // ---------------------------------------------------------------------------- #ifndef __PCL_KeyCodes_h #define __PCL_KeyCodes_h /// \file pcl/KeyCodes.h #include #ifndef __PCL_NO_KEY_QUERY_UTILITIES # ifdef __PCL_WINDOWS # include // for virtual key codes # endif #endif namespace pcl { // ---------------------------------------------------------------------------- /*! * \namespace pcl::KeyCode * \brief Defines PCL key codes. * * The %KeyCode namespace defines platform-independent keyboard key identifiers * on the PixInsight/PCL framework. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
KeyCode::Backspace 0x00000008
KeyCode::Tab 0x00000009
KeyCode::Clear 0x0000000c
KeyCode::Return 0x0000000d
KeyCode::Enter 0x0000000d
KeyCode::Escape 0x0000001b
KeyCode::Shift 0x70000001
KeyCode::Control 0x70000002
KeyCode::Alt 0x70000003
KeyCode::Meta 0x70000004
KeyCode::CapsLock 0x70000010
KeyCode::NumLock 0x70000020
KeyCode::ScrollLock 0x70000030
KeyCode::Pause 0x70000100
KeyCode::Print 0x70000200
KeyCode::Help 0x70000300
KeyCode::SysReq 0x70000400
KeyCode::Left 0x10000001
KeyCode::Up 0x10000002
KeyCode::Right 0x10000003
KeyCode::Down 0x10000004
KeyCode::Insert 0x10000010
KeyCode::Delete 0x10000020
KeyCode::Home 0x10000100
KeyCode::End 0x10000200
KeyCode::PageUp 0x10000300
KeyCode::PageDown 0x10000400
KeyCode::F1 0x08000001
KeyCode::F2 0x08000002
KeyCode::F3 0x08000003
KeyCode::F4 0x08000004
KeyCode::F5 0x08000005
KeyCode::F6 0x08000006
KeyCode::F7 0x08000007
KeyCode::F8 0x08000008
KeyCode::F9 0x08000009
KeyCode::F10 0x0800000a
KeyCode::F11 0x0800000b
KeyCode::F12 0x0800000c
KeyCode::F13 0x0800000d
KeyCode::F14 0x0800000e
KeyCode::F15 0x0800000f
KeyCode::F16 0x08000010
KeyCode::F17 0x08000020
KeyCode::F18 0x08000030
KeyCode::F19 0x08000040
KeyCode::F20 0x08000050
KeyCode::F21 0x08000060
KeyCode::F22 0x08000070
KeyCode::F23 0x08000080
KeyCode::F24 0x08000090
KeyCode::Space 0x00000020
KeyCode::Exclamation 0x00000021
KeyCode::DoubleQuote 0x00000022
KeyCode::NumberSign 0x00000023
KeyCode::Dollar 0x00000024
KeyCode::Percent 0x00000025
KeyCode::Ampersand 0x00000026
KeyCode::Apostrophe 0x00000027
KeyCode::LeftParenthesis 0x00000028
KeyCode::RightParenthesis 0x00000029
KeyCode::Asterisk 0x0000002a
KeyCode::Plus 0x0000002b
KeyCode::Comma 0x0000002c
KeyCode::Minus 0x0000002d
KeyCode::Period 0x0000002e
KeyCode::Slash 0x0000002f
KeyCode::Zero 0x00000030
KeyCode::One 0x00000031
KeyCode::Two 0x00000032
KeyCode::Three 0x00000033
KeyCode::Four 0x00000034
KeyCode::Five 0x00000035
KeyCode::Six 0x00000036
KeyCode::Seven 0x00000037
KeyCode::Eight 0x00000038
KeyCode::Nine 0x00000039
KeyCode::Colon 0x0000003a
KeyCode::Semicolon 0x0000003b
KeyCode::Less 0x0000003c
KeyCode::Equal 0x0000003d
KeyCode::Greater 0x0000003e
KeyCode::Question 0x0000003f
KeyCode::At 0x00000040
KeyCode::A 0x00000041
KeyCode::B 0x00000042
KeyCode::C 0x00000043
KeyCode::D 0x00000044
KeyCode::E 0x00000045
KeyCode::F 0x00000046
KeyCode::G 0x00000047
KeyCode::H 0x00000048
KeyCode::I 0x00000049
KeyCode::J 0x0000004a
KeyCode::K 0x0000004b
KeyCode::L 0x0000004c
KeyCode::M 0x0000004d
KeyCode::N 0x0000004e
KeyCode::O 0x0000004f
KeyCode::P 0x00000050
KeyCode::Q 0x00000051
KeyCode::R 0x00000052
KeyCode::S 0x00000053
KeyCode::T 0x00000054
KeyCode::U 0x00000055
KeyCode::V 0x00000056
KeyCode::W 0x00000057
KeyCode::X 0x00000058
KeyCode::Y 0x00000059
KeyCode::Z 0x0000005a
KeyCode::LeftBracket 0x0000005b
KeyCode::Backslash 0x0000005c
KeyCode::RightBracket 0x0000005d
KeyCode::Circumflex 0x0000005e
KeyCode::Underscore 0x0000005f
KeyCode::LeftQuote 0x00000060
KeyCode::LeftBrace 0x0000007b
KeyCode::Bar 0x0000007c
KeyCode::RightBrace 0x0000007d
KeyCode::Tilde 0x0000007e
KeyCode::Unknown 0x7fffffff
*/ namespace KeyCode { enum value_type { Backspace = 0x00000008, Tab = 0x00000009, Clear = 0x0000000c, Return = 0x0000000d, Enter = 0x0000000d, Escape = 0x0000001b, Shift = 0x70000001, Control = 0x70000002, Alt = 0x70000003, Meta = 0x70000004, CapsLock = 0x70000010, NumLock = 0x70000020, ScrollLock = 0x70000030, Pause = 0x70000100, Print = 0x70000200, Help = 0x70000300, SysReq = 0x70000400, Left = 0x10000001, Up = 0x10000002, Right = 0x10000003, Down = 0x10000004, Insert = 0x10000010, Delete = 0x10000020, Home = 0x10000100, End = 0x10000200, PageUp = 0x10000300, PageDown = 0x10000400, F1 = 0x08000001, F2 = 0x08000002, F3 = 0x08000003, F4 = 0x08000004, F5 = 0x08000005, F6 = 0x08000006, F7 = 0x08000007, F8 = 0x08000008, F9 = 0x08000009, F10 = 0x0800000a, F11 = 0x0800000b, F12 = 0x0800000c, F13 = 0x0800000d, F14 = 0x0800000e, F15 = 0x0800000f, F16 = 0x08000010, F17 = 0x08000020, F18 = 0x08000030, F19 = 0x08000040, F20 = 0x08000050, F21 = 0x08000060, F22 = 0x08000070, F23 = 0x08000080, F24 = 0x08000090, Space = 0x00000020, Exclamation = 0x00000021, DoubleQuote = 0x00000022, NumberSign = 0x00000023, Dollar = 0x00000024, Percent = 0x00000025, Ampersand = 0x00000026, Apostrophe = 0x00000027, LeftParenthesis = 0x00000028, RightParenthesis = 0x00000029, Asterisk = 0x0000002a, Plus = 0x0000002b, Comma = 0x0000002c, Minus = 0x0000002d, Period = 0x0000002e, Slash = 0x0000002f, Zero = 0x00000030, One = 0x00000031, Two = 0x00000032, Three = 0x00000033, Four = 0x00000034, Five = 0x00000035, Six = 0x00000036, Seven = 0x00000037, Eight = 0x00000038, Nine = 0x00000039, Colon = 0x0000003a, Semicolon = 0x0000003b, Less = 0x0000003c, Equal = 0x0000003d, Greater = 0x0000003e, Question = 0x0000003f, At = 0x00000040, A = 0x00000041, B = 0x00000042, C = 0x00000043, D = 0x00000044, E = 0x00000045, F = 0x00000046, G = 0x00000047, H = 0x00000048, I = 0x00000049, J = 0x0000004a, K = 0x0000004b, L = 0x0000004c, M = 0x0000004d, N = 0x0000004e, O = 0x0000004f, P = 0x00000050, Q = 0x00000051, R = 0x00000052, S = 0x00000053, T = 0x00000054, U = 0x00000055, V = 0x00000056, W = 0x00000057, X = 0x00000058, Y = 0x00000059, Z = 0x0000005a, LeftBracket = 0x0000005b, Backslash = 0x0000005c, RightBracket = 0x0000005d, Circumflex = 0x0000005e, Underscore = 0x0000005f, LeftQuote = 0x00000060, LeftBrace = 0x0000007b, Bar = 0x0000007c, RightBrace = 0x0000007d, Tilde = 0x0000007e, Unknown = 0x7fffffff }; } #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION /*! * \defgroup keyboard_utilities Keyboard Utilities */ /*! * Returns true iff the specified keyboard key is currently pressed. * * The \a key1 and (optional) \a key2 parameters are platform-dependent * keyboard scan codes or virtual key identifiers. * * \ingroup keyboard_utilities */ bool IsKeyPressed( int key1, int key2 = 0 ); // implemented in pcl/Keyboard.cpp #ifndef __PCL_NO_KEY_QUERY_UTILITIES /*! * Returns true iff the Space Bar key is currently pressed. * \ingroup keyboard_utilities */ inline bool IsSpaceBarPressed() { return IsKeyPressed( #if defined( __PCL_X11 ) 65 #endif #if defined( __PCL_MACOSX ) 0x31 // kVK_Space #endif #if defined( __PCL_WINDOWS ) VK_SPACE #endif ); } /*! * Returns true iff a Control key (also known as Meta key on Mac OS X) is * currently pressed. * \ingroup keyboard_utilities */ inline bool IsControlPressed() { return IsKeyPressed( #if defined( __PCL_X11 ) 37, 109 #endif #if defined( __PCL_MACOSX ) 0x3B // kVK_Control #endif #if defined( __PCL_WINDOWS ) VK_CONTROL #endif ); } /*! * Returns true iff a Shift key is currently pressed. * \ingroup keyboard_utilities */ inline bool IsShiftPressed() { return IsKeyPressed( #if defined( __PCL_X11 ) 50, 62 #endif #if defined( __PCL_MACOSX ) 0x38 // kVK_Shift #endif #if defined( __PCL_WINDOWS ) VK_SHIFT #endif ); } /*! * Returns true iff an Alt key (also known as Option key on Mac OS X) is * currently pressed. * \ingroup keyboard_utilities */ inline bool IsAltPressed() { return IsKeyPressed( #if defined( __PCL_X11 ) 64, 113 #endif #if defined( __PCL_MACOSX ) 0x3A // kVK_Option #endif #if defined( __PCL_WINDOWS ) VK_MENU #endif ); } #if defined( __PCL_MACOSX ) /*! * Returns true iff the Command key (Mac keyboard only) is currently pressed. * * \note This function is only defined on Mac OS X. * \ingroup keyboard_utilities */ inline bool IsCmdPressed() { return IsKeyPressed( 0x37 ); // kVK_Command } /*! * Returns true iff the Meta key is currently pressed on the Mac keyboard. * * This function is a convenient alias for IsControlPressed(), only available * on Mac OS X. * * \ingroup keyboard_utilities */ inline bool IsMetaPressed() { return IsControlPressed(); } #endif // __PCL_MACOSX /*! * On UNIX, Linux and Windows platforms, returns true iff a Control key is * currently pressed. On macOS, returns true iff the Command key is currently * pressed. * * \ingroup keyboard_utilities */ inline bool IsControlOrCmdPressed() { #if defined( __PCL_MACOSX ) return IsCmdPressed(); #else return IsControlPressed(); #endif } #endif // !__PCL_NO_KEY_QUERY_UTILITIES #endif // !__PCL_BUILDING_PIXINSIGHT_APPLICATION // ---------------------------------------------------------------------------- } // pcl #endif // __PCL_KeyCodes_h // ---------------------------------------------------------------------------- // EOF pcl/KeyCodes.h - Released 2022-03-12T18:59:29Z