-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyShortcuts.cpp
More file actions
22 lines (20 loc) · 979 Bytes
/
KeyShortcuts.cpp
File metadata and controls
22 lines (20 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
// Created by Kristal Hong on 11/16/23.
//
#include "KeyShortcuts.h"
bool KeyShortcuts::isUndo() {
// Check if either Ctrl (or Command on Mac) and Z keys are pressed
return (sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Z) &&
(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::LControl) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::RControl) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::LSystem) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::RSystem)));
}
bool KeyShortcuts::isRedo() {
// Check if either Ctrl (or Command on Mac) and Y keys are pressed
return (sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Y) &&
(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::LControl) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::RControl) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::LSystem) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::RSystem)));
}