ekapalka
12-04-2013, 13:49
I was just wondering if you could use the left half of the keyboard (1, 2, 3, 4, 5, 6, q, w, e, r, t, a, s, d, f, g, z, x, c, v, b, [shift], [ctrl], and arrow keys (yes I know they're not on the left side)) to interface with the robot. I'm not trying to use a text input box or anything; just press the key and have something happen. I've been looking through the SmartDashboard Class Reference (http://www.virtualroadside.com/WPILib/class_smart_dashboard.html), specifically static bool GetBoolean (std::string keyName) but I have no way of testing anything I program at the moment. I'm intending to use the arrow keys to control the up/down/left/right movement of a pan and tilt assembly (just to test the keyboard functionality). Is this possible? Thanks!
virtuald
12-04-2013, 20:11
You would need to create a custom widget to do this. Definitely possible though, you just need to get ahold of the parent window, and listen to key events there. Or do what the driver station does, and listen to key events globally... though not sure if you can do that from Java.
ekapalka
12-04-2013, 20:57
How about C++? I had a feeling it wouldn't be easy.... Does that mean that in order to do It I would have to learn how to modify/create a SmartDashboard and learn Network tables? Is there some way to modify a commercially available USB or PS/2 half-keyboard to function as a joystick (so I could just use GetRawButton(x)? Or am I over thinking this?
panicnot42
29-04-2013, 16:30
Use PPJoy to create a virtual joystick, then use GlovePIE to redirect keys to joystick buttons. We used this in the past to access the DPad on a joystick
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.