📄 mmieditor.c
字号:
TRACE_EVENT("press hash");
SEND_EVENT (win, E_EDITOR_DEINIT, INFO_KCD_LEFT, NULL);
}
break;
case KCD_LEFT:
if ( data->emergency_call EQ TRUE )
{
TRACE_EVENT("press left < min");
/* get the orginal text back into the editor instead of the
hide buffer ( only filled with '*') */
if (data->editor_data.hide)
editor_hideTerminate(data);
SEND_EVENT (win, E_EDITOR_DEINIT, INFO_EMERGENCY, NULL);
}
else if (strlen(data->editor_data.editor_attr.text) >= data->editor_data.min_enter)
{
/* left Softkey is enabled (and entered sufficient number of chars): execute it */
//KGT
/* get the orginal text back into the editor instead of the
hide buffer ( only filled with '*') */
if (data->editor_data.hide)
editor_hideTerminate(data);
//end KGT
TRACE_EVENT("press left");
SEND_EVENT (win, E_EDITOR_DEINIT, INFO_KCD_LEFT, NULL);
}
else
{
/* NOP */
TRACE_EVENT("NOP");
}
break;
case KCD_HUP:
/* API - 15/10/02 - 1162 - Update the Editor TextId after Deleting a value
from the text editor.
*/
if(cm_check_emergency((U8*)data->tmpBuf))
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEmergency;
data->emergency_call = TRUE;
}
else
{
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
break;
case KCD_CALL:
SEND_EVENT (win, E_EDITOR_DEINIT, INFO_KCD_CALL, NULL);
break;
if ( data->emergency_call EQ TRUE ) {
TRACE_EVENT("press left < min");
/* get the orginal text back into the editor instead of the
hide buffer ( only filled with '*') */
if (data->editor_data.hide)
editor_hideTerminate(data);
SEND_EVENT (win, E_EDITOR_DEINIT, INFO_EMERGENCY, NULL);
}
break;
case KCD_RIGHT:
/* API - 15/10/02 - 1162 - Update the Editor TextId after Deleting a value
from the text editor.
*/
TRACE_EVENT("Delete key pressed!");
if(cm_check_emergency((U8*)data->tmpBuf))
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEmergency;
data->emergency_call = TRUE;
}
else
{
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
if(data->editor_data.editor_attr.text[0] NEQ '\0')
{
/* buffer is not empty, delete the char before the cursor */
//KGT
if ( data->editor_data.hide )
{
U8 uMode;
editor_hideClear(data);
/* API - 15/10/02 - 1162 - Update the Editor TextId after Deleting a value
from the text editor.
*/
if(cm_check_emergency((U8*)data->tmpBuf))
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEmergency;
data->emergency_call = TRUE;
}
else
{
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
if (data->editor_data.min_enter > 0 || data->emergency_call)
{
win_show(data->edt_win); /* in order to update the Softkeys */
}
else
{
edtShow(data->edt_edt);
}
}
else
//end KGT
{
edtChar(data->edt_edt,ecBack);
// this is for the ss_string
if (strlen(data->editor_data.editor_attr.text) EQ 0 && data->ss_string)
{
data->ss_string = FALSE;
//the string should be visible on screen
data->editor_data.hide = TRUE;
}
/* is it a emergency call number ?!*/
/* API - 15/10/02 - 1162 - Update the Editor TextId after Deleting a value
from the text editor.
*/
if(cm_check_emergency((U8*)data->tmpBuf))
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEmergency;
data->emergency_call = TRUE;
}
else
{
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
if (data->editor_data.min_enter > 0 )
{
win_show(data->edt_win); /* in order to update the Softkeys */
}
else
{
edtShow(data->edt_edt);
}
}
}
break;
default: /* any key */
if (data->editor_data.mode NEQ READ_ONLY_MODE) /* ignore normal keys if in read-only mode */
{
if ( data->editor_data.hide )
{
U8 uMode;
TRACE_EVENT(" hide mode");
editor_hideInsert(data,keyboard->code);
/* API - 15/10/02 - 1162 - Check to see if the inputed value into the PIN editor is
an emergency number.
*/
if((strlen((char*)data->tmpBuf) > 1) && (strlen((char*)data->tmpBuf) < 4))
{
if(cm_check_emergency((UBYTE*)data->tmpBuf))
{
TRACE_EVENT(" it is a emergency number !");
data->emergency_call = TRUE;
//Clear the TextId string before adding
data->editor_data.TextId = '\0';
//Change the TextId to display Emergency ?
data->editor_data.TextId = TxtEmergency;
displaySoftKeys(TxtSoftCall, data->editor_data.RightSoftKey);
}
else
{
TRACE_EVENT("data->emergency_call = FALSE");
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
}
else
{
TRACE_EVENT("data->emergency_call = FALSE");
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
if (data->editor_data.min_enter > 0 || data->emergency_call)
{
win_show(data->edt_win); /* in order to update the Softkeys */
}
else
{
edtShow(data->edt_edt);
TRACE_EVENT(" edtShow");
}
}
else
{
TRACE_EVENT(" unhide mode");
editEventKey(event,keyboard);
/* API - 15/10/02 - 1162 - Check to see if the inputed value into the PIN editor is
an emergency number.
*/
if((strlen((char*)data->editor_data.editor_attr.text) > 1) && (strlen((char*)data->editor_data.editor_attr.text) < 4))
{
TRACE_EVENT("EMERGENCY CHECK POINT!");
if(cm_check_emergency((U8*)data->editor_data.editor_attr.text))
{
TRACE_EVENT(" it is a emergency number !");
data->emergency_call = TRUE;
//Clear the TextId string before adding
data->editor_data.TextId = '\0';
//Change the TextId to display Emergency ?
data->editor_data.TextId = TxtEmergency;
}
else
{
TRACE_EVENT("data->emergency_call = FALSE");
if (sim_status_check() == SIM_NOT_ACTIVE)
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtNoCard;
}
else
{
data->editor_data.TextId = '\0';
data->editor_data.TextId = TxtEnterPin1;
}
data->emergency_call = FALSE;
}
}
else
{
TRACE_EVENT("data->emergency_call = FALSE");
data->emergency_call = FALSE;
}
if (data->editor_data.min_enter > 0)
{
win_show(data->edt_win); /* in order to update the Softkeys */
}
else
{
edtShow(data->edt_edt);
}
}
}
break;
}
break;
}
}
#ifdef EASY_TEXT_ENABLED
else
if(FFS_flashData.PredTextAvailable == TRUE)
{TRACE_EVENT("In predictive mode");
sprintf(debug, "Key: %d", keyboard->code);
TRACE_EVENT(debug);
if (event & KEY_LONG)
{
switch (keyboard->code)
{
case KCD_CALL:
SEND_EVENT (win, E_EDITOR_DEINIT, INFO_KCD_CALL, NULL);
break;
case KCD_RIGHT: //empty predictive text string
if(PredText[0] NEQ '\0')
{
PredText[0]= '\0';
ResetDictSearch();
}
else //empty whole editor
{
if(data->editor_data.editor_attr.text[0] NEQ '\0')
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -