From: Seoyeon Kim Date: Mon, 11 Mar 2019 06:04:43 +0000 (+0900) Subject: [Tizen] Add GetLogicalKey API in DevelKeyEvent X-Git-Tag: accepted/tizen/unified/20190520.084041~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=622e0df51d2538bb6f55abd135c43d9a3567b120;p=platform%2Fcore%2Fuifw%2Fdali-core.git [Tizen] Add GetLogicalKey API in DevelKeyEvent - Added GetLogicalKey API to get the logical key. (eg. '1' key of NumberPad -> logicalKey : "KP_1") Change-Id: I1f0424d31646c310a1471f745e5172c8e9cdbbf1 Signed-off-by: Seoyeon Kim --- diff --git a/dali/devel-api/CMakeLists.txt b/dali/devel-api/CMakeLists.txt index 0aca8ad..c9c559e 100644 --- a/dali/devel-api/CMakeLists.txt +++ b/dali/devel-api/CMakeLists.txt @@ -8,6 +8,7 @@ SET( SOURCES ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/common/hash.cpp ${CMAKE_CURRENT_SOURCE_DIR}/common/stage-devel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/events/hit-test-algorithm.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/events/key-event-devel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-data-devel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/images/distance-field.cpp ${CMAKE_CURRENT_SOURCE_DIR}/images/texture-set-image.cpp @@ -44,6 +45,7 @@ SET( DEVEL_API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/common/stage-devel.h ${CMAKE_CURRENT_SOURCE_DIR}/events/hit-test-algorithm.h + ${CMAKE_CURRENT_SOURCE_DIR}/events/key-event-devel.h ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-data-devel.h ${CMAKE_CURRENT_SOURCE_DIR}/images/distance-field.h diff --git a/dali/devel-api/events/key-event-devel.cpp b/dali/devel-api/events/key-event-devel.cpp new file mode 100644 index 0000000..502404e --- /dev/null +++ b/dali/devel-api/events/key-event-devel.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace DevelKeyEvent +{ + +std::string GetLogicalKey( KeyEvent keyEvent ) +{ + return GetImplementation( &keyEvent )->GetLogicalKey(); +} + +} // namespace DevelKeyEvent + +} // namespace Dali + diff --git a/dali/devel-api/events/key-event-devel.h b/dali/devel-api/events/key-event-devel.h new file mode 100644 index 0000000..bdf1680 --- /dev/null +++ b/dali/devel-api/events/key-event-devel.h @@ -0,0 +1,45 @@ +#ifndef DALI_KEY_EVENT_DEVEL_H +#define DALI_KEY_EVENT_DEVEL_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace DevelKeyEvent +{ + +/** + * @brief Gets the logical key string. + * + * For example, when the user presses 'shift' key and '1' key together, the logical key is "exclamation". + * Plus, the keyPressedName is "1", and the keyPressed is "!". + * + * @param[in] keyEvent The instance of KeyEvent. + * @return The logical key symbol + */ +DALI_CORE_API std::string GetLogicalKey( KeyEvent keyEvent ); + +} // namespace DevelKeyEvent + +} // namespace Dali + +#endif // DALI_KEY_EVENT_DEVEL_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index bd74e49..06b2fb7 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -9,6 +9,7 @@ devel_api_src_files = \ $(devel_api_src_dir)/common/stage-devel.cpp \ $(devel_api_src_dir)/events/hit-test-algorithm.cpp \ $(devel_api_src_dir)/events/touch-data-devel.cpp \ + $(devel_api_src_dir)/events/key-event-devel.cpp \ $(devel_api_src_dir)/images/distance-field.cpp \ $(devel_api_src_dir)/images/texture-set-image.cpp \ $(devel_api_src_dir)/images/nine-patch-image.cpp \ @@ -47,7 +48,8 @@ devel_api_core_common_header_files = \ devel_api_core_events_header_files = \ $(devel_api_src_dir)/events/hit-test-algorithm.h \ - $(devel_api_src_dir)/events/touch-data-devel.h + $(devel_api_src_dir)/events/touch-data-devel.h \ + $(devel_api_src_dir)/events/key-event-devel.h devel_api_core_images_header_files = \ $(devel_api_src_dir)/images/distance-field.h \