Movatterモバイル変換


[0]ホーム

URL:


Loading...
Searching...
No Matches
Keyboard.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#pragma once
26
28// Headers
31
32
33namespacesf
34{
35classString;
36
41namespaceKeyboard
42{
51enum classKey
52{
54A = 0,
155};
156
161// NOLINTNEXTLINE(readability-identifier-naming)
162staticconstexprunsignedintKeyCount{static_cast<unsignedint>(Key::Pause) + 1};
163
172enum classScan
173{
175A = 0,
220// For US keyboards mapped to key 29 (Microsoft Keyboard Scan Code Specification)
221// For Non-US keyboards mapped to key 42 (Microsoft Keyboard Scan Code Specification)
222// Typical language mappings: Belg:£µ` FrCa:<>} Dan:*' Dutch:`´ Fren:µ* Ger:'# Ital:§ù LatAm:[}` Nor:*@ Span:ç} Swed:*' Swiss:$£} UK:~# Brazil:}]
286// For US keyboards doesn't exist
287// For Non-US keyboards mapped to key 45 (Microsoft Keyboard Scan Code Specification)
288// Typical language mappings: Belg:<> FrCa:«°» Dan:<> Dutch:]|[ Fren:<> Ger:<|> Ital:<> LatAm:<> Nor:<> Span:<> Swed:<|> Swiss:<> UK:\| Brazil: \|.
327};
328
330
335// NOLINTNEXTLINE(readability-identifier-naming)
336staticconstexprunsignedintScancodeCount{static_cast<unsignedint>(Scan::LaunchMediaSelect) + 1};
337
349[[nodiscard]]SFML_WINDOW_APIboolisKeyPressed(Key key);
350
363
378
393
416
431}// namespace Keyboard
432
433}// namespace sf
434
435
#define SFML_WINDOW_API
Utility string class that automatically handles conversions between types and encodings.
DefinitionString.hpp:89
Give access to the real-time state of the keyboard.
DefinitionKeyboard.hpp:42
Key localize(Scancode code)
Localize a physical key to a logical one.
static constexpr unsigned int KeyCount
The total number of keyboard keys, ignoring Key::Unknown
static constexpr unsigned int ScancodeCount
The total number of scancodes, ignoring Scan::Unknown
Scancode delocalize(Key key)
Identify the physical key corresponding to a logical one.
String getDescription(Scancode code)
Provide a string representation for a given scancode.
void setVirtualKeyboardVisible(bool visible)
Show or hide the virtual keyboard.
Key
Key codes.
DefinitionKeyboard.hpp:52
@ Escape
The Escape key.
DefinitionKeyboard.hpp:90
@ Num6
The 6 key.
DefinitionKeyboard.hpp:86
@ RAlt
The right Alt key.
DefinitionKeyboard.hpp:97
@ Down
Down arrow.
@ Divide
The / key.
@ Pause
The Pause key.
@ Numpad9
The numpad 9 key.
@ LBracket
The [ key.
@ Period
The . key.
@ Numpad0
The numpad 0 key.
@ Subtract
The - key (minus, usually from numpad)
@ F6
The F6 key.
@ F14
The F14 key.
@ RSystem
The right OS specific key: window (Windows and Linux), apple (macOS), ...
DefinitionKeyboard.hpp:98
@ Slash
The / key.
@ F5
The F5 key.
@ Numpad7
The numpad 7 key.
@ F7
The F7 key.
@ F8
The F8 key.
@ Num7
The 7 key.
DefinitionKeyboard.hpp:87
@ F3
The F3 key.
@ Numpad6
The numpad 6 key.
@ Numpad4
The numpad 4 key.
@ Comma
The , key.
@ Tab
The Tabulation key.
@ Numpad3
The numpad 3 key.
@ Numpad5
The numpad 5 key.
@ F11
The F11 key.
@ LShift
The left Shift key.
DefinitionKeyboard.hpp:92
@ Hyphen
The - key (hyphen)
@ Num2
The 2 key.
DefinitionKeyboard.hpp:82
@ Num5
The 5 key.
DefinitionKeyboard.hpp:85
@ Num0
The 0 key.
DefinitionKeyboard.hpp:80
@ End
The End key.
@ Unknown
Unhandled key.
DefinitionKeyboard.hpp:53
@ F9
The F9 key.
@ Num8
The 8 key.
DefinitionKeyboard.hpp:88
@ Numpad8
The numpad 8 key.
@ Home
The Home key.
@ RShift
The right Shift key.
DefinitionKeyboard.hpp:96
@ Right
Right arrow.
@ Left
Left arrow.
@ F13
The F13 key.
@ Semicolon
The ; key.
@ PageUp
The Page up key.
@ LControl
The left Control key.
DefinitionKeyboard.hpp:91
@ Num3
The 3 key.
DefinitionKeyboard.hpp:83
@ Insert
The Insert key.
@ LAlt
The left Alt key.
DefinitionKeyboard.hpp:93
@ RControl
The right Control key.
DefinitionKeyboard.hpp:95
@ F10
The F10 key.
@ Menu
The Menu key.
DefinitionKeyboard.hpp:99
@ Apostrophe
The ' key.
@ Num1
The 1 key.
DefinitionKeyboard.hpp:81
@ RBracket
The ] key.
@ Numpad1
The numpad 1 key.
@ Backspace
The Backspace key.
@ Space
The Space key.
@ Num9
The 9 key.
DefinitionKeyboard.hpp:89
@ Num4
The 4 key.
DefinitionKeyboard.hpp:84
@ F1
The F1 key.
@ Multiply
The * key.
@ F15
The F15 key.
@ F4
The F4 key.
@ F12
The F12 key.
@ Grave
The ` key.
@ PageDown
The Page down key.
@ Enter
The Enter/Return keys.
@ Delete
The Delete key.
@ Equal
The = key.
@ Backslash
The \ key.
@ Numpad2
The numpad 2 key.
@ LSystem
The left OS specific key: window (Windows and Linux), apple (macOS), ...
DefinitionKeyboard.hpp:94
@ F2
The F2 key.
bool isKeyPressed(Key key)
Check if a key is pressed.
Scan
Scancodes.
@ LaunchMediaSelect
Keyboard Launch Media Select key.
@ Back
Keyboard Back key.
@ Stop
Keyboard Stop key.
@ Search
Keyboard Search key.
@ Undo
Keyboard Undo key.
@ MediaPreviousTrack
Keyboard Media Previous Track key.
@ LaunchMail
Keyboard Launch Mail key.
@ Paste
Keyboard Paste key.
@ NumpadMultiply
Keypad * key.
@ Execute
Keyboard Execute key.
@ NumpadEnter
Keypad Enter/Return key.
@ MediaStop
Keyboard Media Stop key.
@ MediaNextTrack
Keyboard Media Next Track key.
@ F16
Keyboard F16 key.
@ Redo
Keyboard Redo key.
@ Copy
Keyboard Copy key.
@ Refresh
Keyboard Refresh key.
@ Forward
Keyboard Forward key.
@ Help
Keyboard Help key.
@ LaunchApplication2
Keyboard Launch Application 2 key.
@ F21
Keyboard F21 key.
@ ScrollLock
Keyboard Scroll Lock key.
@ F22
Keyboard F22 key.
@ F18
Keyboard F18 key.
@ F23
Keyboard F23 key.
@ NumpadEqual
keypad = key
@ CapsLock
Keyboard Caps Lock key.
@ VolumeDown
Keyboard Volume Down key.
@ VolumeMute
Keyboard Volume Mute key.
@ NumpadDecimal
Keypad . and Delete key.
@ NumpadPlus
Keypad + key.
@ MediaPlayPause
Keyboard Media Play Pause key.
@ NumpadDivide
Keypad / key.
@ PrintScreen
Keyboard Print Screen key.
@ HomePage
Keyboard Home Page key.
@ NonUsBackslash
Keyboard Non-US \ and | key.
@ F19
Keyboard F19 key.
@ NumLock
Keypad Num Lock and Clear key.
@ LaunchApplication1
Keyboard Launch Application 1 key.
@ Favorites
Keyboard Favorites key.
@ Select
Keyboard Select key.
@ Application
Keyboard Application key.
@ ModeChange
Keyboard Mode Change key.
@ Cut
Keyboard Cut key.
@ F24
Keyboard F24 key.
@ VolumeUp
Keyboard Volume Up key.
@ NumpadMinus
Keypad - key.
@ F20
Keyboard F20 key.
@ F17
Keyboard F17 key.

[8]ページ先頭

©2009-2025 Movatter.jp