Lines Matching refs:hat_dir
723 case HID_GD_UP: usage->hat_dir = 1; break; in hidinput_configure_usage()
724 case HID_GD_DOWN: usage->hat_dir = 5; break; in hidinput_configure_usage()
725 case HID_GD_RIGHT: usage->hat_dir = 3; break; in hidinput_configure_usage()
726 case HID_GD_LEFT: usage->hat_dir = 7; break; in hidinput_configure_usage()
1249 (usage->hat_min < usage->hat_max || usage->hat_dir)) { in hidinput_configure_usage()
1255 if (usage->hat_dir && !field->dpad) in hidinput_configure_usage()
1331 if (usage->hat_min < usage->hat_max || usage->hat_dir) { in hidinput_hid_event()
1332 int hat_dir = usage->hat_dir; in hidinput_hid_event() local
1333 if (!hat_dir) in hidinput_hid_event()
1334 hat_dir = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1; in hidinput_hid_event()
1335 if (hat_dir < 0 || hat_dir > 8) hat_dir = 0; in hidinput_hid_event()
1336 input_event(input, usage->type, usage->code , hid_hat_to_axis[hat_dir].x); in hidinput_hid_event()
1337 input_event(input, usage->type, usage->code + 1, hid_hat_to_axis[hat_dir].y); in hidinput_hid_event()