input_event.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2011 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Harry Storbacka
00028 */
00029 
00032 
00033 #pragma once
00034 
00035 #include "../api_display.h"
00036 #include "input_device.h"
00037 #include "../../Core/Math/point.h"
00038 
00039 class CL_InputEvent_Impl;
00040 
00044 class CL_API_DISPLAY CL_InputEvent
00045 {
00046 public:
00048         enum Type
00049         {
00050                 no_key            = 0,
00051                 pressed           = 1,
00052                 released          = 2,
00053                 doubleclick       = 3,
00054                 pointer_moved     = 4,
00055                 axis_moved        = 5,
00056                 proximity_change  = 6
00057         };
00058 
00060         enum TabletAxisID
00061         {
00062                 x_axis            = 0,
00063                 y_axis            = 1,
00064                 z_axis            = 2,
00065                 tilt_x            = 3,
00066                 tilt_y            = 4,
00067                 rotation_pitch    = 6,
00068                 rotation_roll     = 7,
00069                 rotation_yaw      = 8,
00070                 proximity_enter   = 9,
00071                 proximity_exit    = 10
00072         };
00073 
00076 
00077 public:
00079         CL_InputEvent();
00080 
00081         ~CL_InputEvent();
00082 
00086 
00087 public:
00088 
00092 
00093 public:
00095         int id;
00096 
00098 
00103         CL_String str;
00104 
00106         Type type;
00107 
00109         CL_InputDevice device;
00110 
00112         CL_Point mouse_pos;
00113 
00115         double axis_pos;
00116 
00118 
00120         int repeat_count;
00121 
00123         bool alt;
00124         bool shift;
00125         bool ctrl;
00126 
00130 
00131 private:
00132         CL_SharedPtr<CL_InputEvent_Impl> impl;
00134 };
00135