X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fshuttle.C;h=80d2fdff01a39bfeea539cebd89e6442ca93a46c;hb=02fe8e44992e30bdd98a1949506b54460c5f2f96;hp=22adeaf01180c29609e9d3280870313bc84ad403;hpb=2e28d225c343f02500594688bf8d0528df40600c;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/shuttle.C b/cinelerra-5.1/cinelerra/shuttle.C index 22adeaf0..80d2fdff 100644 --- a/cinelerra-5.1/cinelerra/shuttle.C +++ b/cinelerra-5.1/cinelerra/shuttle.C @@ -504,6 +504,8 @@ int Shuttle::send_keycode(unsigned key, unsigned msk, int press, int send) k->x = wx; k->y = wy; k->state = msk; +// also clear modifiers state if a key is to be released + if( !press ) k->state = 0; k->keycode = key; k->same_screen = 1; wdw->top_level->put_event((XEvent *) k); @@ -553,6 +555,11 @@ void Shuttle::key(unsigned short code, unsigned int value) fprintf(stderr, "key(%d, %d) out of range\n", code + EVENT_CODE_KEY1, value); return; } +// Show help if Alt is pressed on the keyboard together with a shuttle button + if( wdw && wdw->alt_down() && value ) { + wdw->context_help_show("Shuttle key default arrangement"); + return; + } send_stroke_sequence(value ? KJS_KEY_DOWN : KJS_KEY_UP, code); } @@ -603,6 +610,8 @@ void Shuttle::jogshuttle(unsigned short code, unsigned int value) case EVENT_CODE_SHUTTLE: shuttle(value); break; + case EVENT_CODE_HI_JOG: // redundant report of JOG value*120 + break; default: fprintf(stderr, "jogshuttle(%d, %d) invalid code\n", code, value); break; @@ -615,10 +624,18 @@ static const struct shuttle_dev { } shuttle_devs[] = { { "/dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00", 0x0b33, 0x0020 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-mouse", + 0x0b33, 0x0020 }, { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-if00", 0x0b33, 0x0030 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-mouse", + 0x0b33, 0x0030 }, { "/dev/input/by-id/usb-Contour_Design_ShuttlePro-event-if00", 0x0b33, 0x0030 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttlePro-event-mouse", + 0x0b33, 0x0030 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-joystick", + 0x0b33, 0x0030 }, }; #ifdef HAVE_SHUTTLE_USB @@ -847,7 +864,7 @@ void Shuttle::run() while( devsh && !done ) { int len = 0; static const int IN_ENDPOINT = 0x81; - unsigned char dat[BCSTRLEN]; + unsigned char dat[5]; int ret = libusb_interrupt_transfer(devsh, IN_ENDPOINT, dat, sizeof(dat), &len, 100); if( ret != 0 ) { @@ -891,7 +908,7 @@ void Shuttle::run() if( first_time ) break; continue; } - if( !ioctl(fd, EVIOCGRAB, 1) ) { // exclusive access + if( 1 || !ioctl(fd, EVIOCGRAB, 1) ) { // exclusive access first_time = 0; while( !done ) { int ret = read(fd, &ev, sizeof(ev));