NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 56 57 58 59 60 … 93 Next »
Handeling Remote Control Buttons being pressed

 
  • 0 Vote(s) - 0 Average
Handeling Remote Control Buttons being pressed
cgmt
Offline

Member

Posts: 86
Threads: 14
Joined: Apr 2006
#1
2006-05-12, 02:15 AM
I am writing my first pluggin and I need to know how to handle the Play,Stop,Pause buttongs that are pressed on the remote in the KeyPress Event. I need to be able to trap the Play and Stop buttons being pressed on the remote anddo some action. I would assume that it would be in the OnKeyDown event but not sure how to handle non keyboard items. If anyone could point me in the write direction, I wouldgreately appreciate it.

Thanks in advance
Intel 3GH
MSI FSB 800 MHz
2GB2 DDR RAM
HD Sizes: 250GB, 500GB, 500GB
ATI Raedon 256 MB
2 Hauppauge PVR 150
Windows XP Pro SP2
Wireless 802.11g WEP
Wireless MVP
Wired MVP
GBPVR v1.2.9
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 108,479
Threads: 784
Joined: Nov 2003
#2
2006-05-12, 02:20 AM
The buttons will appear as regular keyboard events. Ctrl-P play, Ctrl-S stop, Ctrl-Q pause etc.

Your plugin will only get these key events when it is the active plugin.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#3
2006-05-12, 02:26 AM
the remote key presses are these by default
play - ctrl P
stop - ctrl S
pause - ctrl Q
skip - ctrl right
prev - ctrl left
ff - ctrl f
rwd - ctrl d

so in the keypress you can use
Code:
bool handled = false; // return this to tell gbpvr that we handled the keypress so it wont if(e.KeyCode== Keys.Right && e.Control) { // do some with the skip button handled = true; }

or you could use a keymappings file which will allow the user to change the keys to whatever they like.
Code:
private GBPVR.Public.KeyCommandHelper helper; // create the keymappings helper private void init(){ helper = new GBPVR.Public.KeyCommandHelper("my plugin.xml"); } public bool onkeydown(System.Windows.Forms.KeyEventArgs e){ // this will return the name of the command that goes allong with the key press // eg "Menu", "Play" check other keymapping files for other examples string command = helper.KeyMapping(e); if(command == BUTTON_PLAY){ } }

that shouild get you started...
cgmt
Offline

Member

Posts: 86
Threads: 14
Joined: Apr 2006
#4
2006-05-12, 11:37 AM
Thats exactly what I needed. Thanks!
Intel 3GH
MSI FSB 800 MHz
2GB2 DDR RAM
HD Sizes: 250GB, 500GB, 500GB
ATI Raedon 256 MB
2 Hauppauge PVR 150
Windows XP Pro SP2
Wireless 802.11g WEP
Wireless MVP
Wired MVP
GBPVR v1.2.9
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Remote control example code? drmargarit 4 5,440 2018-04-21, 11:24 PM
Last Post: drmargarit
  API help - remote control greg in kansas 0 3,220 2016-07-04, 03:54 PM
Last Post: greg in kansas
  ios app to control npvr ui idea jnbooker15 4 4,723 2015-09-21, 10:19 PM
Last Post: sub
  ios app to control npvr ui idea jnbooker15 0 3,046 2015-09-21, 06:39 PM
Last Post: jnbooker15
  TitanTv Remote Schedule For GBPVR UncleJohnsBand 51 40,096 2015-08-20, 05:11 PM
Last Post: sub
  Remote client logout timeout. mvallevand 2 3,299 2014-10-28, 12:55 AM
Last Post: mvallevand
  Kinect Voice (Gesture) Control topcat 5 4,743 2014-09-20, 12:03 PM
Last Post: topcat
  Version control / repository software for VS Express bgowland 2 3,257 2014-05-02, 09:57 PM
Last Post: bgowland
  Web control framework mvallevand 9 6,176 2011-07-06, 12:30 AM
Last Post: mvallevand
  Skin question - how to centre a list UiList control on screen? McBainUK 2 2,544 2011-02-17, 08:46 AM
Last Post: McBainUK

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode