diff options
Diffstat (limited to 'ISEDefaultNUI/SCLNUI.cs')
-rw-r--r-- | ISEDefaultNUI/SCLNUI.cs | 82 |
1 files changed, 69 insertions, 13 deletions
diff --git a/ISEDefaultNUI/SCLNUI.cs b/ISEDefaultNUI/SCLNUI.cs index 747c11c..4fb3178 100644 --- a/ISEDefaultNUI/SCLNUI.cs +++ b/ISEDefaultNUI/SCLNUI.cs @@ -9,7 +9,7 @@ using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; using Tizen.Uix.InputMethod; using static Interop.SclNuiCSharp; - +
namespace ISEDefaultNUI { class SCLNUI : Page @@ -42,6 +42,9 @@ namespace ISEDefaultNUI private string[] sigDec = { ".", "-" }; private uint[] sigDecEvent = { '.', '-' }; private Timer commitTimer; + private Timer showEmoticonTimer; + private View emoticonView = null; + private EmoticonPage emoticonPage = null;
enum LabelAlignment { @@ -79,7 +82,10 @@ namespace ISEDefaultNUI label_list = new List<TextLabel>(); commitTimer = new Timer(1000); - commitTimer.Tick += CommitTimerTick; + commitTimer.Tick += CommitTimerTick;
+
+ showEmoticonTimer = new Timer(10);
+ showEmoticonTimer.Tick += showEmoticonTimerTick; /* Draw text callback */ _draw_text_cb = (IntPtr font_name, short font_size, bool is_italic, bool is_bold, int r, int g, int b, int a, @@ -262,6 +268,9 @@ namespace ISEDefaultNUI IntPtr inputModePtr; SclNuiGetInputMode(out inputModePtr); string inputMode = Marshal.PtrToStringAnsi(inputModePtr); + + Log.Info("NUIIME", "key value: " + keyValue + ", keyType: " + keyType + ", inputmode: " + inputMode); + if (keyModifier == SclNuiKeyModifier.MultitapStart) { if (keyboardState.MultitapValue.Length > 0) @@ -344,6 +353,7 @@ namespace ISEDefaultNUI const string capsLock = "CapsLock"; const string deleteAll = "DeleteAll"; const string hidePanel = "Hide"; + const string EmoticonLayout = "EMOTICON_LAYOUT"; if (keyValue.Equals(longShift)) { Log.Info("NUIIME", "shift key is longpress"); @@ -368,7 +378,8 @@ namespace ISEDefaultNUI SclNuiSetShiftState((uint)ShiftState.Off); KeyboardState.Instance.ResetMultitapState(true); InputMethodEditor.RequestHide(); - } + }
+
else if (key_event > 0) { Common.SendKeyEvent((KeyCode)key_event); @@ -376,7 +387,13 @@ namespace ISEDefaultNUI break; case SclNuiKeyType.Modechange: break; - case SclNuiKeyType.User: + case SclNuiKeyType.User:
+ { + String substring = keyValue.Substring(0, 15); + Log.Info("NUIIME", "key substring " + substring); + if (substring.Equals("EMOTICON_GROUP_"))
+ emoticonPage?.SetEmoticonGroup(keyValue);
+ }
break; case SclNuiKeyType.Max: break; @@ -386,16 +403,18 @@ namespace ISEDefaultNUI if (keyValue.Equals("OPTION")) { - /* AppControl appControl = new AppControl(); appControl.Operation = AppControlOperations.Default; appControl.ApplicationId = ResourceManager.IseSettingAppId; appControl.ExtraData.Add("caller", "NUI_IME"); appControl.LaunchMode = AppControlLaunchMode.Group; AppControl.SendLaunchRequest(appControl); - */ - - ShowEmoticonLayout(); + } + else if (keyValue.Equals("EMOTICON_LAYOUT"))
+ {
+ ShowEmoticonLayout();
+
+ Log.Info("NUIIME", "emoticon");
} if (keyValue.Equals("Space") && afterPositionX != 0 && Math.Abs(beforePositionX - afterPositionX) > 100 && !inputMode.Equals("SYM_QTY_1")) @@ -426,6 +445,8 @@ namespace ISEDefaultNUI if (keyValue.Equals("CUR_LANG")) { + HideEmoticonLayout(); + this.SetUpdatePending(true); LanguageInfo currentLanguage = LanguageManager.Instance.GetLanguageInfo(LanguageManager.Instance.GetCurrentLanguage()); this.SetInputMode(currentLanguage.SelectedInputMode); @@ -506,6 +527,21 @@ namespace ISEDefaultNUI return true; } + private void ShowEmoticonLayout()
+ { + if (showEmoticonTimer.IsRunning())
+ showEmoticonTimer.Stop();
+
+ showEmoticonTimer.Start();
+ } + + private bool showEmoticonTimerTick(object source, Timer.TickEventArgs e) + {
+ Log.Info("NUIIME", "emoticon layout timer");
+ OnShowEmoticonLayoutTimer(); + return false;
+ } + private void OnResized(object sender, Window.ResizedEventArgs e) { SclNuiSetRotation((int)Window.Instance.GetCurrentOrientation()); @@ -679,11 +715,22 @@ namespace ISEDefaultNUI } } - private void ShowEmoticonLayout() + private void OnShowEmoticonLayoutTimer() + { + emoticonPage = new EmoticonPage(); + emoticonView = emoticonPage.GetView(); + Add(emoticonView); + } + + private void HideEmoticonLayout() { - navigator.RemoveAll(); - EmoticonPage emoticonPage = new EmoticonPage(navigator); - navigator.Push(emoticonPage); + Log.Info("NUIIME", "Hide emoticon layout"); + + if (emoticonView) + Remove(emoticonView); + + emoticonView?.Dispose(); + emoticonView = null; } public int Init(string entry_filepath) @@ -698,7 +745,16 @@ namespace ISEDefaultNUI public int SetInputMode(string mode) { - return SclNuiSetInputMode(mode); + int ret = SclNuiSetInputMode(mode); + + Log.Info("NUIIME", "Input mode: " + mode); + + if (mode.Equals("EMOTICON_LAYOUT")) + ShowEmoticonLayout(); + else + HideEmoticonLayout(); + + return ret; } public int SetUpdatePending(bool pend) |