~ adjust keycodes
This commit is contained in:
parent
14c1335881
commit
5bc558c7b1
@ -32,12 +32,12 @@ int main() {
|
|||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::C) {
|
if((drawRender.getKeyCode()) == vkvm::KeyCode::C) {
|
||||||
drawRender.graphicsUpdate(CIRCLE);
|
drawRender.graphicsUpdate(CIRCLE);
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::R) {
|
else if((drawRender.getKeyCode()) == vkvm::KeyCode::R) {
|
||||||
drawRender.graphicsUpdate(RECTANGLE);
|
drawRender.graphicsUpdate(RECTANGLE);
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
@ -67,12 +67,12 @@ int main() {
|
|||||||
mousePosition.y = mousePosition.y - 30;
|
mousePosition.y = mousePosition.y - 30;
|
||||||
drawRender.setMousePostion(mousePosition);
|
drawRender.setMousePostion(mousePosition);
|
||||||
|
|
||||||
if(((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::C) && drawRender.getPainting()) {
|
if(((drawRender.getKeyCode()) == vkvm::KeyCode::C) && drawRender.getPainting()) {
|
||||||
drawRender.graphicsUpdate(CIRCLE);
|
drawRender.graphicsUpdate(CIRCLE);
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::R) && drawRender.getPainting()) {
|
else if(((drawRender.getKeyCode()) == vkvm::KeyCode::R) && drawRender.getPainting()) {
|
||||||
drawRender.graphicsUpdate(RECTANGLE);
|
drawRender.graphicsUpdate(RECTANGLE);
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
@ -87,12 +87,12 @@ int main() {
|
|||||||
vkvm::registerEvent(vkvm::EventType::KeyDown, [&drawRender]() {
|
vkvm::registerEvent(vkvm::EventType::KeyDown, [&drawRender]() {
|
||||||
drawRender.setKeyCode(vkvm::getLastPressedKey());
|
drawRender.setKeyCode(vkvm::getLastPressedKey());
|
||||||
|
|
||||||
if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::D) {
|
if((drawRender.getKeyCode()) == vkvm::KeyCode::D) {
|
||||||
drawRender.clear();
|
drawRender.clear();
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::Q) {
|
else if((drawRender.getKeyCode()) == vkvm::KeyCode::Q) {
|
||||||
drawRender.graphicsUpdate(SHAPE);
|
drawRender.graphicsUpdate(SHAPE);
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ int main() {
|
|||||||
vkvm::registerEvent(vkvm::EventType::KeyUp, [&drawRender]() {
|
vkvm::registerEvent(vkvm::EventType::KeyUp, [&drawRender]() {
|
||||||
drawRender.setKeyCode(vkvm::getLastPressedKey());
|
drawRender.setKeyCode(vkvm::getLastPressedKey());
|
||||||
|
|
||||||
if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::D) {
|
if((drawRender.getKeyCode()) == vkvm::KeyCode::D) {
|
||||||
drawRender.clear();
|
drawRender.clear();
|
||||||
vkvm::callEvent(vkvm::EventType::Redraw);
|
vkvm::callEvent(vkvm::EventType::Redraw);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include <Color.hpp>
|
#include <Color.hpp>
|
||||||
#include <vkvm.hpp>
|
#include <vkvm.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "Font.h"
|
|
||||||
#include "vector"
|
#include "vector"
|
||||||
#include "utils.hpp"
|
#include "utils.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
Loading…
Reference in New Issue
Block a user