示例#1
0
static irqreturn_t handle_capture_irqs(int irq, void * dev_id, struct pt_regs * regs)
{
    capture_key(BlsKey);
    return IRQ_HANDLED;
}
示例#2
0
void OptionsMenu::capture_stats_click() {
    capture_key(ck_stats);
}
示例#3
0
void OptionsMenu::capture_escape_click() {
    capture_key(ck_escape);
}
示例#4
0
void OptionsMenu::capture_drop3_click() {
    capture_key(ck_drop3);
}
示例#5
0
void OptionsMenu::capture_chat_click() {
    capture_key(ck_chat);
}
示例#6
0
void OptionsMenu::capture_jump_click() {
    capture_key(ck_jump);
}
示例#7
0
void OptionsMenu::capture_fire_click() {
    capture_key(ck_fire);
}
示例#8
0
void OptionsMenu::capture_right_click() {
    capture_key(ck_right);
}
示例#9
0
void OptionsMenu::capture_left_click() {
    capture_key(ck_left);
}
示例#10
0
void OptionsMenu::capture_down_click() {
    capture_key(ck_down);
}
示例#11
0
void OptionsMenu::capture_up_click() {
    capture_key(ck_up);
}
int main( int argc, char **argv ) {

	char *filename;
	struct INPUT *input;
	int x1, y1;
	int x2, y2;
	int TopX, TopY;
	int BottomX, BottomY;

	if( argc != 2 ) {
		fprintf( stderr, "usage: %s event-device - probably /dev/input/event0\n", argv[0] );
		exit( 1 );
	}

	filename = argv[1];

	input = open_input( filename );

	fprintf(
		stderr,
		"\nPlease, press the stilus at ANY\n"
		"corner of your desired working area: "
	);
	capture_key( input, &x1, &y1, NUM_REGISTER_KEYS, register_keys );
	fprintf( stderr, "ok, got %d,%d\n", x1, y1 );

	fprintf(
		stderr,
		"\nPlease, press the stilus at OPPOSITE\n"
		"corner of your desired working area: "
	);
	capture_key( input, &x2, &y2, NUM_REGISTER_KEYS, register_keys );
	fprintf( stderr, "ok, got %d,%d\n", x2, y2 );

	if( x2 > x1 ) {
		TopX = x1;
		BottomX = x2;
	} else {
		TopX = x2;
		BottomX = x1;
	}

	if( y2 > y1 ) {
		TopY = y1;
		BottomY = y2;
	} else {
		TopY = y2;
		BottomY = y1;
	}

	fprintf(
		stderr,
		"\nAccording to your input you may put following\n"
		"lines into your XF86Config file:\n"
		"\n"
	);
	printf(
		"\tDriver\t\t\"wizardpen\"\n"
		"\tOption\t\t\"Device\"\t\"%s\"\n"
		"\tOption\t\t\"TopX\"\t\t\"%d\"\n"
		"\tOption\t\t\"TopY\"\t\t\"%d\"\n"
		"\tOption\t\t\"BottomX\"\t\"%d\"\n"
		"\tOption\t\t\"BottomY\"\t\"%d\"\n"
		"\tOption\t\t\"MaxX\"\t\t\"%d\"\n"
		"\tOption\t\t\"MaxY\"\t\t\"%d\"\n",
		filename,
		TopX, TopY,
		BottomX, BottomY,
		BottomX, BottomY
	);

	close_input( input );
	exit( 0 );
}