~ adjust keycodes

This commit is contained in:
Johannes Theiner 2019-12-18 12:18:35 +01:00
parent 14c1335881
commit 5bc558c7b1
2 changed files with 7 additions and 8 deletions

View File

@ -32,12 +32,12 @@ int main() {
vkvm::callEvent(vkvm::EventType::Redraw);
}
if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::C) {
if((drawRender.getKeyCode()) == vkvm::KeyCode::C) {
drawRender.graphicsUpdate(CIRCLE);
vkvm::callEvent(vkvm::EventType::Redraw);
}
else if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::R) {
else if((drawRender.getKeyCode()) == vkvm::KeyCode::R) {
drawRender.graphicsUpdate(RECTANGLE);
vkvm::callEvent(vkvm::EventType::Redraw);
}
@ -67,12 +67,12 @@ int main() {
mousePosition.y = mousePosition.y - 30;
drawRender.setMousePostion(mousePosition);
if(((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::C) && drawRender.getPainting()) {
if(((drawRender.getKeyCode()) == vkvm::KeyCode::C) && drawRender.getPainting()) {
drawRender.graphicsUpdate(CIRCLE);
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);
vkvm::callEvent(vkvm::EventType::Redraw);
}
@ -87,12 +87,12 @@ int main() {
vkvm::registerEvent(vkvm::EventType::KeyDown, [&drawRender]() {
drawRender.setKeyCode(vkvm::getLastPressedKey());
if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::D) {
if((drawRender.getKeyCode()) == vkvm::KeyCode::D) {
drawRender.clear();
vkvm::callEvent(vkvm::EventType::Redraw);
}
else if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::Q) {
else if((drawRender.getKeyCode()) == vkvm::KeyCode::Q) {
drawRender.graphicsUpdate(SHAPE);
vkvm::callEvent(vkvm::EventType::Redraw);
}
@ -101,7 +101,7 @@ int main() {
vkvm::registerEvent(vkvm::EventType::KeyUp, [&drawRender]() {
drawRender.setKeyCode(vkvm::getLastPressedKey());
if((drawRender.getKeyCode() - 65536) == vkvm::KeyCode::D) {
if((drawRender.getKeyCode()) == vkvm::KeyCode::D) {
drawRender.clear();
vkvm::callEvent(vkvm::EventType::Redraw);
}

View File

@ -8,7 +8,6 @@
#include <Color.hpp>
#include <vkvm.hpp>
#include <iostream>
#include "Font.h"
#include "vector"
#include "utils.hpp"
#include <cmath>