📄 event_key.c.svn-base
字号:
#include <stdio.h>#include <glib.h>#include <assert.h>#include "player_pub.h"#include "base_types.h"#include "instance.h"#include "swf_file_pub.h"#include "dynamic_text_ins.h"#include "dynamic_text_def.h"#include "spliter_pub.h"#include "render_pub.h"#include "movie_clips_ins.h"#include "button_ins.h"#include "button_def.h"#include "xwin_pub.h"#include "xwin_event.h"#include "action.h"#include "action_fortest.h"#include <string.h>#include "dynamic_var.h"#if WITH_DMALLOC#include <dmalloc.h>#endifextern player_t *player_p;to_exec_t event_key(flash_event_t *fe_p) { swf_file_t *swf_p = player_p->_level0_p; dtx_ins_t *dtx_data_p; GNode *focused_node_p=NULL; to_exec_t to_exec; to_exec.name_p = NULL; // 如果 focused_name 所指的节点已经不在,则什么也不做. if (swf_p->focused_name) focused_node_p = ins_name_to_node(swf_p->_root_p,swf_p->focused_name); if (!focused_node_p) { free(swf_p->focused_name); swf_p->focused_name = NULL; return to_exec; }; dtx_data_p = (dtx_ins_t*)focused_node_p->data; switch (dtx_data_p->ins_type) { case INS_DTX: { char key[2]; char *str_p = NULL; char *old_value_p; key[0] = fe_p->key_value; key[1] = 0; assert(dtx_data_p->var_full_name_p); old_value_p = dvar_get_value(dtx_data_p->var_full_name_p); if (!old_value_p) { if (key[0] != 0x8) { //退格键 str_p = g_strdup(key); }; } else { if (key[0] == 0x8) { //退格键 int len = strlen(old_value_p) - 1; if (len >= 0) str_p = g_strndup(old_value_p,len); } else { str_p = g_strconcat(old_value_p,key,0L); }; }; dvar_set_value(dtx_data_p->var_full_name_p,str_p); dtx_update_shape(focused_node_p); dtx_data_p->dirty = TRUE; TextField_SyncBuffer(dtx_data_p->var_full_name_p,str_p); printf("focused ---%s---\n",g_datalist_get_data(&swf_p->dvar_list_p,dtx_data_p->var_full_name_p)); break; } case INS_BTN: break; }; return to_exec;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -