Go to Post I want to wish everyone a Happy Ship Day. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-04-2013, 13:49
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Using the keyboard

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, specifically
Code:
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!
Reply With Quote
  #2   Spotlight this post!  
Unread 12-04-2013, 20:11
virtuald's Avatar
virtuald virtuald is online now
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,089
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Using the keyboard

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.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #3   Spotlight this post!  
Unread 12-04-2013, 20:57
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using the keyboard

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?
Reply With Quote
  #4   Spotlight this post!  
Unread 29-04-2013, 16:30
panicnot42 panicnot42 is offline
Registered User
AKA: Joe D
FRC #1334
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Canada
Posts: 10
panicnot42 is an unknown quantity at this point
Re: Using the keyboard

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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi