<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" width="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-162" width="81">
<label>
<rec>.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" width="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-162" width="81">
<label>
<rec>。</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" widht="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-162" widht="81">
<label>
<rec>.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" width="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-163" width="81">
<label>
<rec>。</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" width="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-162" width="81">
<label>
<rec>.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264" width="128">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302" width="128">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" width="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-162" width="81">
<label>
<rec>.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
<rec>Space</rec>
</key_value>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-472" popup_offset_y="-326" width="81">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_DOT" image_label_type="IMAGE_CUE" popup_offset_x="-305" popup_offset_y="-162" width="81">
<label>
<rec>.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>www.</rec>
</label>
<rec button="disabled">button/B09_Qwerty_l_btn_02.png</rec>
</background_image>
</key>
- <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-100" popup_offset_y="-264">
+ <key key_type="string" popup_type="longpress_popup_once" label_type="QTY_WWWCOM" popup_offset_x="-82" popup_offset_y="-302">
<label>
<rec>.com</rec>
</label>
#endif
extern void set_ise_imdata(const char * buf, size_t &len);
+static void update_recent_used_punctuation(const char *key_value);
+static sclboolean g_popup_opened = FALSE;
+static vector<string> g_recent_used_punctuation;
+const int MAX_DEFAULT_PUNCTUATION = 6;
+static string g_default_punctuation[MAX_DEFAULT_PUNCTUATION] = {"-", "@", "'", "!", "?", ","};
+static string g_current_punctuation[MAX_DEFAULT_PUNCTUATION-1] = {"&", "^", "%", "$", "#"};
KEYBOARD_STATE g_keyboard_state = {
0,
g_need_send_shift_event = FALSE;
}
}
+ else if(noti_type == SCL_UINOTITYPE_POPUP_OPENING)
+ {
+ g_popup_opened = TRUE;
+ vector<string>::reverse_iterator iter = g_recent_used_punctuation.rbegin();
+ int punc_pos = 0;
+ for(; iter!=g_recent_used_punctuation.rend(); ++iter)
+ {
+ g_ui->set_string_substitution(g_current_punctuation[punc_pos].c_str(), iter->c_str());
+ punc_pos++;
+ }
+ }
return ret;
}
if (g_ui) {
switch (event_desc.key_type) {
- case KEY_TYPE_STRING:
+ case KEY_TYPE_STRING:{
if (event_desc.key_modifier != KEY_MODIFIER_MULTITAP_START &&
event_desc.key_modifier != KEY_MODIFIER_MULTITAP_REPEAT) {
if (event_desc.key_event) {
ise_send_string(event_desc.key_value);
}
}
+ const sclchar *input_mode = g_ui->get_input_mode();
+ if((strcmp(input_mode, "SYM_QTY_1")) || (strcmp(input_mode, "SYM_QTY_2"))){
+ update_recent_used_punctuation(event_desc.key_value);
+ }
+ if(g_popup_opened){
+ update_recent_used_punctuation(event_desc.key_value);
+ g_popup_opened = FALSE;
+ }
break;
+ }
case KEY_TYPE_CHAR: {
sclboolean need_forward = FALSE;
// FIXME : Should decide when to forward key events
ise_send_event(event_desc.key_event, KEY_MASK_NULL);
}
}
+ if((strcmp(input_mode, "SYM_QTY_1") == 0) || (strcmp(input_mode, "SYM_QTY_2"))){
+ update_recent_used_punctuation(event_desc.key_value);
+ }
break;
}
case KEY_TYPE_CONTROL: {
SclSize size_landscape = g_ui->get_input_mode_size(g_ui->get_input_mode(), DISPLAYMODE_LANDSCAPE);
g_core.set_keyboard_size_hints(size_portrait, size_landscape);
}
+
+ if(g_recent_used_punctuation.empty())
+ {
+ for(int i=0; i<MAX_DEFAULT_PUNCTUATION-1; ++i)
+ {
+ g_recent_used_punctuation.push_back(g_current_punctuation[MAX_DEFAULT_PUNCTUATION-2-i]);
+ }
+ }
}
void
}
return FALSE;
}
+
+static void update_recent_used_punctuation(const char * key_value)
+{
+ if(NULL == key_value)
+ {
+ return;
+ }
+ for(int i=0; i<10; ++i)
+ {
+ char buf[5] = {0};
+ sprintf(buf, "%d", i);
+ if(strcmp(key_value, buf) == 0)
+ {
+ return;
+ }
+ }
+ string strKey = string(key_value);
+ for(int i=0; i<MAX_DEFAULT_PUNCTUATION; ++i)
+ {
+ if(0 == strKey.compare(g_default_punctuation[i].c_str()))
+ {
+ return;
+ }
+ }
+ vector<string>::iterator iter = g_recent_used_punctuation.begin();
+ for(; iter!=g_recent_used_punctuation.end(); ++iter)
+ {
+ if(0 == strKey.compare(iter->c_str()))
+ {
+ break;
+ }
+ }
+ if(iter != g_recent_used_punctuation.end())
+ {
+ g_recent_used_punctuation.erase(iter);
+ }
+ g_recent_used_punctuation.push_back(strKey);
+ if(g_recent_used_punctuation.size() > MAX_DEFAULT_PUNCTUATION-1)
+ {
+ g_recent_used_punctuation.erase(g_recent_used_punctuation.begin());
+ }
+}