From e70ebdb9b0186779ddcdc2d0f6d8eceb81c85101 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 Apr 2016 21:24:44 +0300 Subject: Add copy constructor into KeyInput. --- src/input/keyinput.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/input/keyinput.h b/src/input/keyinput.h index 81db273cc..fb8246cf5 100644 --- a/src/input/keyinput.h +++ b/src/input/keyinput.h @@ -84,6 +84,27 @@ class KeyInput final mActionId(InputAction::UNDEFINED_VALUE) { } + KeyInput(const KeyInput &k) : + mKey(k.mKey), + mType(k.mType), +#ifdef USE_SDL2 + mText(k.mText), +#endif + mActionId(k.mActionId) + { + } + + KeyInput &operator=(const KeyInput &k) + { + mKey = k.mKey; + mType = k.mType; +#ifdef USE_SDL2 + mText = k.mText; +#endif + mActionId = k.mActionId; + return *this; + } + ~KeyInput() { } -- cgit v1.2.3-70-g09d2