int ti_thumbscript_down(TWidget * wid, int btn)
{
	switch (btn) {
	case TTK_BUTTON_ACTION:
		ti_thumbscript_push(4);
		wid->dirty = 1;
		break;
	case TTK_BUTTON_PREVIOUS:
		ttk_input_char(TTK_INPUT_LEFT);
		ti_thumbscript_lastch = 0;
		break;
	case TTK_BUTTON_NEXT:
		ttk_input_char(TTK_INPUT_RIGHT);
		ti_thumbscript_lastch = 0;
		break;
	case TTK_BUTTON_PLAY:
		ttk_input_char(TTK_INPUT_ENTER);
		ti_thumbscript_lastch = 0;
		break;
	case TTK_BUTTON_MENU:
		ttk_input_end();
		break;
	default:
		return TTK_EV_UNUSED;
		break;
	}
	return TTK_EV_CLICK;
}
int ti_mlwlb_scroll(TWidget * wid, int dir)
{
	TTK_SCROLLMOD (dir,4);
	
	if (dir<0) {
		if (ti_mlwlb_curcset<0) {
			ttk_input_char(TTK_INPUT_LEFT);
		} else {
			if ((ti_mlwlb_position--)==0) {
				ti_mlwlb_advance_level(0);
			}
			wid->dirty=1;
		}
	} else {
		if (ti_mlwlb_curcset<0) {
			ttk_input_char(TTK_INPUT_RIGHT);
		} else {
			if ((ti_mlwlb_position++)==6) {
				ti_mlwlb_advance_level(1);
			}
			wid->dirty=1;
		}
	}
	return TTK_EV_CLICK;
}
void ti_thumbscript_push(int n)
{
	int fc, lc, ch = 0;
	if (ti_thumbscript_last == 0) {
		ti_thumbscript_last = n+1;
	} else {
		fc = ti_thumbscript_last-1;
		lc = n;
		ti_thumbscript_last = 0;
		
		switch (ti_thumbscript_mode) {
		case 0: /* normal */
			ch = ti_thumbscript_normal[fc*9 + lc];
			break;
		case 1: /* shift */
			ch = ti_thumbscript_shift[fc*9 + lc];
			break;
		case 3: /* mod */
		case 2: /* cmd */
		case 4: /* alt */
		case 5: /* meta/ctrl */
		case 6: /* fn */
			ch = ti_thumbscript_mod[fc*9 + lc];
			break;
		}
		if (ch < 7) {
			ti_thumbscript_mode = ch;
		} else {
			ti_thumbscript_mode = 0;
			if ((ch >= 128) && (ch <= 136)) {
				fc = ti_thumbscript_lastch;
				if ((fc >= 'A') && (fc <= 'Z')) {
					ch = ti_thumbscript_accents[(ch-128)*52 + 0 + (fc-'A')];
				} else if ((fc >= 'a') && (fc <= 'z')) {
					ch = ti_thumbscript_accents[(ch-128)*52 + 26 + (fc-'a')];
				} else {
					return;
				}
				ti_thumbscript_lastch = ch;
				ttk_input_char(8);
				ttk_input_char(ch);
			} else {
				ti_thumbscript_lastch = ch;
				ttk_input_char(ch);
			}
		}
	}
}
void ti_mlwlb_input(unsigned short i)
{
	if (ti_mlwlb_endian == 0x000A || ti_mlwlb_curcset < 0 || ti_mlwlb_numeric) {
		ttk_input_char(i);
	} else {
		ttk_input_char(((i & 0xFF00) >> 8) | ((i & 0x00FF) << 8));
	}
}
Beispiel #5
0
int ti_dial_scroll(TWidget * wid, int dir)
{
	TTK_SCROLLMOD (dir, 4);
	
	if (dir<0) {
		if (ti_dial_cursormode()) {
			ttk_input_char(TTK_INPUT_LEFT);
		} else {
			ti_dial_prev_char();
			wid->dirty = 1;
		}
	} else {
		if (ti_dial_cursormode()) {
			ttk_input_char(TTK_INPUT_RIGHT);
		} else {
			ti_dial_next_char();
			wid->dirty = 1;
		}
	}
	return TTK_EV_CLICK;
}
int ti_mlwlb_down(TWidget * wid, int btn)
{
	switch (btn)
	{
	case TTK_BUTTON_PLAY:
		ttk_input_char(TTK_INPUT_ENTER);
		break;
	case TTK_BUTTON_PREVIOUS:
		ttk_input_char(TTK_INPUT_BKSP);
		break;
	case TTK_BUTTON_NEXT:
		ttk_input_char(32);
		break;
	case TTK_BUTTON_MENU:
		ttk_input_end();
		break;
	default:
		return TTK_EV_UNUSED;
		break;
	}
	return TTK_EV_CLICK;
}
Beispiel #7
0
int ti_dial_down(TWidget * wid, int btn)
{
	switch (btn) {
	case TTK_BUTTON_ACTION:
		if (ti_dial_cursormode() || ti_dial_charlist_pos == ti_dial_max()) {
			ti_dial_togglecursor();
			wid->dirty = 1;
		} else if (ti_dial_mode >= 2 && ti_dial_mode <= 8 && ti_dial_charlist_pos >= 32) {
			ti_dial_mode = (ti_dial_charlist_pos - 30);
			ti_dial_reset();
			wid->dirty = 1;
		} else {
			ttk_input_char(ti_dial_rotatechar(ti_dial_get_char(-1)));
			if (ti_dial_snapback) {
				ti_dial_reset();
				wid->dirty = 1;
			}
		}
		break;
	case TTK_BUTTON_PREVIOUS:
		ttk_input_char(TTK_INPUT_BKSP);
		break;
	case TTK_BUTTON_NEXT:
		ttk_input_char(ti_dial_rotatechar(32));
		break;
	case TTK_BUTTON_PLAY:
		ttk_input_char(ti_dial_rotatechar(TTK_INPUT_ENTER));
		break;
	case TTK_BUTTON_MENU:
		ttk_input_end();
		break;
	default:
		return TTK_EV_UNUSED;
		break;
	}
	return TTK_EV_CLICK;
}