--- /dev/null
+
+Copyright (c) 2017 Samsung Electronics Co, Ltd. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/devel-api/events/key-event-devel.h>
// INTERNAL INCLUDES
#include <events/gesture-manager.h>
}
}
+/**
+ * Get the device class from the provided ecore key event
+ */
+void GetDeviceClass( Ecore_Event_Key* keyEvent, DevelKeyEvent::DeviceClass::Type& deviceClass )
+{
+ Ecore_Device_Class ecoreDeviceClass = ecore_device_class_get( keyEvent->dev );
+
+ switch( ecoreDeviceClass )
+ {
+ case ECORE_DEVICE_CLASS_SEAT:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::USER;
+ break;
+ }
+ case ECORE_DEVICE_CLASS_KEYBOARD:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::KEYBOARD;
+ break;
+ }
+ case ECORE_DEVICE_CLASS_MOUSE:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::MOUSE;
+ break;
+ }
+ case ECORE_DEVICE_CLASS_TOUCH:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::TOUCH;
+ break;
+ }
+ case ECORE_DEVICE_CLASS_PEN:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::PEN;
+ break;
+ }
+ case ECORE_DEVICE_CLASS_POINTER:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::POINTER;
+ break;
+ }
+ case ECORE_DEVICE_CLASS_GAMEPAD:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::GAMEPAD;
+ break;
+ }
+ default:
+ {
+ deviceClass = DevelKeyEvent::DeviceClass::NONE;
+ break;
+ }
+ }
+}
} // unnamed namespace
}
std::string deviceName;
+ DevelKeyEvent::DeviceClass::Type deviceClass;
+
GetDeviceName( keyEvent, deviceName );
+ GetDeviceClass( keyEvent, deviceClass );
- DALI_LOG_INFO( gImfLogging, Debug::Verbose, "EVENT EcoreEventKeyDown - >>EcoreEventKeyDown deviceName(%s)\n", deviceName.c_str() );
+ DALI_LOG_INFO( gImfLogging, Debug::Verbose, "EVENT EcoreEventKeyDown - >>EcoreEventKeyDown deviceName(%s) deviceClass(%d)\n", deviceName.c_str(), deviceClass );
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, deviceName );
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, deviceName, deviceClass );
handler->SendEvent( keyEvent );
}
}
}
std::string deviceName;
+ DevelKeyEvent::DeviceClass::Type deviceClass;
+
GetDeviceName( keyEvent, deviceName );
+ GetDeviceClass( keyEvent, deviceClass );
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, deviceName );
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, deviceName, deviceClass );
handler->SendEvent( keyEvent );
}
}
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 36;
+const unsigned int ADAPTOR_MICRO_VERSION = 37;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/devel-api/events/key-event-devel.h>
// INTERNAL INCLUDES
#include <events/gesture-manager.h>
const char * DETENT_DEVICE_NAME = "tizen_detent";
const std::string DEFAULT_DEVICE_NAME = "";
+const DevelKeyEvent::DeviceClass::Type DEFAULT_DEVICE_CLASS = DevelKeyEvent::DeviceClass::NONE;
+
// DBUS accessibility
#define A11Y_BUS "org.a11y.Bus"
#define A11Y_INTERFACE "org.a11y.Bus"
keyString = keyEvent->string;
}
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME );
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS );
handler->SendEvent( keyEvent );
}
}
keyString = keyEvent->string;
}
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME );
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS );
handler->SendEvent( keyEvent );
}
#include <cstdio>
#include <iostream>
#include <cstring>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-core.h>
#define TOKENPASTE(x,y) x y
#define TOKENPASTE2(x,y) TOKENPASTE( x, y )
#define TEST_LOCATION TOKENPASTE2( "Test failed in ", TOKENPASTE2( __FILE__, TOKENPASTE2( ", line ", STRINGIZE(__LINE__) ) ) )
+#define TEST_INNER_LOCATION(x) ( std::string(x) + " (" + STRINGIZE(__LINE__) + ")" ).c_str()
#define TET_UNDEF 2
#define TET_FAIL 1
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.2.36
+Version: 1.2.37
Release: 1
Group: System/Libraries
-License: Apache-2.0 and BSD-2-Clause and MIT
+License: Apache-2.0 and BSD-3-Clause and MIT
URL: https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
Source0: %{name}-%{version}.tar.gz