Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: tools/vulkan/viewer/InputHandler.cpp

Issue 1865553005: Clean up input handling in VulkanViewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename resize params Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/vulkan/viewer/InputHandler.h ('k') | tools/vulkan/viewer/VulkanViewer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vulkan/viewer/InputHandler.cpp
diff --git a/tools/vulkan/viewer/InputHandler.cpp b/tools/vulkan/viewer/InputHandler.cpp
deleted file mode 100644
index 0e78b94f06bcc27a256c3b2c7b06a06e7b719762..0000000000000000000000000000000000000000
--- a/tools/vulkan/viewer/InputHandler.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-* Copyright 2016 Google Inc.
-*
-* Use of this source code is governed by a BSD-style license that can be
-* found in the LICENSE file.
-*/
-
-#include "InputHandler.h"
-#include <ctype.h>
-
-InputHandler::InputHandler() : fMouseDown(false), fMousePressed(false), fMouseReleased(false)
- , fMouseX(0), fMouseY(0) {
- // clear key states
- memset(fKeys, 0, sizeof(bool) * 256);
- memset(fKeyPressed, 0, sizeof(bool) * 256);
- memset(fKeyReleased, 0, sizeof(bool) * 256);
-}
-
-void InputHandler::onKeyDown(unsigned char key) {
- if (!fKeys[key]) {
- fKeys[key] = true;
- fKeyPressed[key] = true;
- }
-}
-
-void InputHandler::onKeyUp(unsigned char key) {
- if (fKeys[key]) {
- fKeys[key] = false;
- fKeyReleased[key] = true;
- }
-}
-
-void InputHandler::onMouseDown(unsigned int h, unsigned int v) {
- if (!fMouseDown) {
- fMouseDown = true;
- fMousePressed = true;
- }
-
- fMouseX = h;
- fMouseY = v;
-}
-
-void InputHandler::onMouseUp() {
- if (fMouseDown) {
- fMouseDown = false;
- fMouseReleased = true;
- }
-}
« no previous file with comments | « tools/vulkan/viewer/InputHandler.h ('k') | tools/vulkan/viewer/VulkanViewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698