/*$cb
 *    This file is a part of OpenMHP VDR plugin.
 *
 *    Copyright (C) 2005 Mikko Novaro <miknov@gmail.com>
 *
 *    See README file for licensing and contact information.
 $ce*/

#include "keymapper.h"

/* See keys.h from VDR, KeyEvent from java standard lib and HRcEvent
   from OpenMHP. */
int KeyMapper::keyMapping[] = {38, // kUp,
			       40, // kDown,
			       -1, // kMenu,
			       10, // kOk,
			       -1, // kBack,
			       37, // kLeft,
			       39, // kRight,
			       403, // kRed,
			       404, // kGreen,
			       405, // kYellow,
			       406, // kBlue,
			       48, // k0, 
			       49, // k1, 
			       50, // k2, 
			       51, // k3, 
			       52, // k4, 
			       53, // k5, 
			       54, // k6, 
			       55, // k7, 
			       56, // k8, 
			       57, // k9,
			       415, // kPlay,
			       -1, // kPause,
			       413, // kStop,
			       416, // kRecord,
			       417, // kFastFwd,
			       412, // kFastRew,
			       409, // kPower,
			       427, // kChanUp,
			       428, // kChanDn,
			       447, // kVolUp,
			       448, // kVolDn,
			       449, // kMute,
			       -1, // kAudio,
			       -1, // kSchedule,
			       -1, // kChannels,
			       -1, // kTimers,
			       -1, // kRecordings,
			       -1, // kSetup,
			       -1, // kCommands,
			       -1, // kUser1, 
			       -1, // kUser2, 
			       -1, // kUser3,
			       -1, // kUser4,
			       -1, // kUser5,
			       -1, // kUser6,
			       -1, // kUser7,
			       -1, // kUser8,
			       -1, // kUser9,
			       -1, // kNone,
			       -1}; // kKbd,



int KeyMapper::Map(eKeys vdrKey) {
  if ((int)vdrKey < 51) return keyMapping[(int)vdrKey];
  else return -1;
}
