示例#1
0
文件: rp.cpp 项目: biglad/WinUAE
bool port_get_custom (int inputmap_port, TCHAR *out)
{
	int kb;
	bool first = true;
	TCHAR *p = out;
	int mode, *events, *axistable;
	int max;
	const TCHAR **eventorder;

	max = inputdevice_get_compatibility_input (&currprefs, inputmap_port, &mode, &events, &axistable);
	if (!max)
		return false;

	int devicetype = -1;
	for (int i = 0; inputdevmode[i * 2]; i++) {
		if (inputdevmode[i * 2 + 1] == currprefs.jports[inputmap_port].mode) {
			devicetype = inputdevmode[i * 2 + 0];
			break;
		}
	}
	if (devicetype < 0)
		return false;

	eventorder = getcustomeventorder (&devicetype);
	if (!eventorder)
		return FALSE;

	_tcscpy (p, KEYBOARDCUSTOM);
	p += _tcslen (p);
	kb = inputdevice_get_device_total (IDTYPE_JOYSTICK) + inputdevice_get_device_total (IDTYPE_MOUSE);
	int kbnum = 0;
	for (int i = 0; eventorder[i]; i++) {
		int evtnum = events[i];
		for (int j = 0; j < inputdevicefunc_keyboard.get_widget_num (kbnum); j++) {
			int port;
			uae_u64 flags;
			if (inputdevice_get_mapping (kb + kbnum, j, &flags, &port, NULL, NULL, 0) == evtnum) {
				if (port == inputmap_port + 1) {
					uae_u32 kc = 0;
					inputdevicefunc_keyboard.get_widget_type (kbnum, j, NULL, &kc);
					if (!first)
						*p++ = ' ';
					first = false;
					_tcscpy (p, eventorder[i]);
					p += _tcslen (p);
					if (flags & IDEV_MAPPED_AUTOFIRE_SET) {
						_tcscpy (p, _T(".autorepeat"));
						p += _tcslen (p);
					}
					_stprintf (p, _T("=%02X"), kc);
					p += _tcslen (p);
				}
			}
		}
	}
	write_log (_T("port_get_custom: %s\n"),  out);
	return true;
}
示例#2
0
static void values_from_dialog(int changedport, bool reset)
{
	int i;
	int changed = 0;
	int prevport;

  if(reset)
    inputdevice_compa_clear (&workprefs, changedport);

	for (i = 0; i < MAX_JPORTS; i++) {
		int prevport = workprefs.jports[i].id;
		int max = JSEM_LASTKBD + inputdevice_get_device_total (IDTYPE_JOYSTICK);
		if (i < 2)
			max += inputdevice_get_device_total (IDTYPE_MOUSE);
    int id = cboPorts[i]->getSelected() - 1;
		if (id < 0) {
			workprefs.jports[i].id = JPORT_NONE;
		} else if (id >= max) {
			workprefs.jports[i].id = JPORT_NONE;
		} else if (id < JSEM_LASTKBD) {
			workprefs.jports[i].id = JSEM_KBDLAYOUT + id;
		} else if (id >= JSEM_LASTKBD + inputdevice_get_device_total (IDTYPE_JOYSTICK)) {
			workprefs.jports[i].id = JSEM_MICE + id - inputdevice_get_device_total (IDTYPE_JOYSTICK) - JSEM_LASTKBD;
		} else {
			workprefs.jports[i].id = JSEM_JOYS + id - JSEM_LASTKBD;
		}

		if (workprefs.jports[i].id != prevport)
			changed = 1;

	  if (i >= 2)
	    continue;

		if(cboPortModes[i] != NULL)
		  workprefs.jports[i].mode = inputmode_val[cboPortModes[i]->getSelected()];
		if(cboAutofires[i] != NULL)
		  workprefs.jports[i].autofire = cboAutofires[i]->getSelected();
	}

  if (changed)
    inputdevice_validate_jports (&workprefs, changedport, NULL);        

	RefreshPanelGamePort();

  inputdevice_config_change();
  if(reset)
    inputdevice_forget_unplugged_device(changedport);
}
示例#3
0
static void fixup_prefs_joysticks (struct uae_prefs *prefs)
{
    int joy_count = inputdevice_get_device_total (IDTYPE_JOYSTICK);

    /* If either port is configured to use a non-existent joystick, try
     * to use a sensible alternative.
     */
    if (prefs->jport0 >= JSEM_JOYS && prefs->jport0 < JSEM_MICE) {
	if (prefs->jport0 - JSEM_JOYS >= joy_count)
	    prefs->jport0 = (prefs->jport1 != JSEM_MICE) ? JSEM_MICE : JSEM_NONE;
    }
    if (prefs->jport1 >= JSEM_JOYS && prefs->jport1 < JSEM_MICE) {
	if (prefs->jport1 - JSEM_JOYS >= joy_count)
	    prefs->jport1 = (prefs->jport0 != JSEM_KBDLAYOUT) ? JSEM_KBDLAYOUT : JSEM_NONE;
    }
}
示例#4
0
void InitPanelGamePort(const struct _ConfigCategory& category)
{
  int j;

  total_devices = 1 + JSEM_LASTKBD;
	for (j = 0; j < inputdevice_get_device_total (IDTYPE_JOYSTICK) && total_devices < 12; j++, total_devices++)
	  inputport_list[total_devices] = inputdevice_get_device_name (IDTYPE_JOYSTICK, j);
	for (j = 0; j < inputdevice_get_device_total (IDTYPE_MOUSE) && total_devices < 12; j++, total_devices++)
		inputport_list[total_devices] = inputdevice_get_device_name (IDTYPE_MOUSE, j);

  ctrlPortList.clear();
  for(j = 0; j < total_devices; ++j)
    ctrlPortList.add(inputport_list[j]);
  
  gameportActionListener = new GamePortActionListener();

  lblPort0 = new gcn::Label("Port 1:");
  lblPort0->setSize(95, LABEL_HEIGHT);
  lblPort0->setAlignment(gcn::Graphics::RIGHT);
	cboPorts[0] = new gcn::UaeDropDown(&ctrlPortList);
  cboPorts[0]->setSize(230, DROPDOWN_HEIGHT);
  cboPorts[0]->setBaseColor(gui_baseCol);
  cboPorts[0]->setId("cboPort0");
  cboPorts[0]->addActionListener(gameportActionListener);

  lblPort1 = new gcn::Label("Port 2:");
  lblPort1->setSize(95, LABEL_HEIGHT);
  lblPort1->setAlignment(gcn::Graphics::RIGHT);
	cboPorts[1] = new gcn::UaeDropDown(&ctrlPortList);
  cboPorts[1]->setSize(230, DROPDOWN_HEIGHT);
  cboPorts[1]->setBaseColor(gui_baseCol);
  cboPorts[1]->setId("cboPort1");
  cboPorts[1]->addActionListener(gameportActionListener);

  lblPort2 = new gcn::Label("paral. Port 1:");
  lblPort2->setSize(95, LABEL_HEIGHT);
  lblPort2->setAlignment(gcn::Graphics::RIGHT);
	cboPorts[2] = new gcn::UaeDropDown(&ctrlPortList);
  cboPorts[2]->setSize(230, DROPDOWN_HEIGHT);
  cboPorts[2]->setBaseColor(gui_baseCol);
  cboPorts[2]->setId("cboPort2");
  cboPorts[2]->addActionListener(gameportActionListener);

  lblPort3 = new gcn::Label("paral. Port 2:");
  lblPort3->setSize(95, LABEL_HEIGHT);
  lblPort3->setAlignment(gcn::Graphics::RIGHT);
	cboPorts[3] = new gcn::UaeDropDown(&ctrlPortList);
  cboPorts[3]->setSize(230, DROPDOWN_HEIGHT);
  cboPorts[3]->setBaseColor(gui_baseCol);
  cboPorts[3]->setId("cboPort3");
  cboPorts[3]->addActionListener(gameportActionListener);

	cboPortModes[0] = new gcn::UaeDropDown(&ctrlPortModeList);
  cboPortModes[0]->setSize(90, DROPDOWN_HEIGHT);
  cboPortModes[0]->setBaseColor(gui_baseCol);
  cboPortModes[0]->setId("cboPortMode0");
  cboPortModes[0]->addActionListener(gameportActionListener);

	cboPortModes[1] = new gcn::UaeDropDown(&ctrlPortModeList);
  cboPortModes[1]->setSize(90, DROPDOWN_HEIGHT);
  cboPortModes[1]->setBaseColor(gui_baseCol);
  cboPortModes[1]->setId("cboPortMode1");
  cboPortModes[1]->addActionListener(gameportActionListener);

	cboAutofires[0] = new gcn::UaeDropDown(&autofireList);
  cboAutofires[0]->setSize(130, DROPDOWN_HEIGHT);
  cboAutofires[0]->setBaseColor(gui_baseCol);
  cboAutofires[0]->setId("cboAutofire0");
  cboAutofires[0]->addActionListener(gameportActionListener);

	cboAutofires[1] = new gcn::UaeDropDown(&autofireList);
  cboAutofires[1]->setSize(130, DROPDOWN_HEIGHT);
  cboAutofires[1]->setBaseColor(gui_baseCol);
  cboAutofires[1]->setId("cboAutofire1");
  cboAutofires[1]->addActionListener(gameportActionListener);

	lblMouseSpeed = new gcn::Label("Mouse Speed:");
  lblMouseSpeed->setSize(95, LABEL_HEIGHT);
  lblMouseSpeed->setAlignment(gcn::Graphics::RIGHT);
  sldMouseSpeed = new gcn::Slider(0, 4);
  sldMouseSpeed->setSize(110, SLIDER_HEIGHT);
  sldMouseSpeed->setBaseColor(gui_baseCol);
	sldMouseSpeed->setMarkerLength(20);
	sldMouseSpeed->setStepLength(1);
	sldMouseSpeed->setId("MouseSpeed");
  sldMouseSpeed->addActionListener(gameportActionListener);
  lblMouseSpeedInfo = new gcn::Label(".25");

	lblAutofireRate = new gcn::Label("Autofire rate:");
  lblAutofireRate->setSize(82, LABEL_HEIGHT);
  lblAutofireRate->setAlignment(gcn::Graphics::RIGHT);
  sldAutofireRate = new gcn::Slider(1, 40);
  sldAutofireRate->setSize(117, SLIDER_HEIGHT);
  sldAutofireRate->setBaseColor(gui_baseCol);
	sldAutofireRate->setMarkerLength(20);
	sldAutofireRate->setStepLength(1);
	sldAutofireRate->setId("AutofireRate");
  sldAutofireRate->addActionListener(gameportActionListener);
  lblAutofireRateInfo = new gcn::Label("XXXX lines.");

//  lblNumLock = new gcn::Label("NumLock LED:");
//  lblNumLock->setSize(100, LABEL_HEIGHT);
//  lblNumLock->setAlignment(gcn::Graphics::RIGHT);
//  cboKBDLed_num = new gcn::UaeDropDown(&KBDLedList);
//  cboKBDLed_num->setSize(150, DROPDOWN_HEIGHT);
//  cboKBDLed_num->setBaseColor(gui_baseCol);
//  cboKBDLed_num->setId("numlock");
//  cboKBDLed_num->addActionListener(gameportActionListener);

//  lblCapLock = new gcn::Label("CapsLock LED:");
//  lblCapLock->setSize(100, LABEL_HEIGHT);
//  lblCapLock->setAlignment(gcn::Graphics::RIGHT);
//  cboKBDLed_cap = new gcn::UaeDropDown(&KBDLedList);
//  cboKBDLed_cap->setSize(150, DROPDOWN_HEIGHT);
//  cboKBDLed_cap->setBaseColor(gui_baseCol);
//  cboKBDLed_cap->setId("capslock");
//  cboKBDLed_cap->addActionListener(gameportActionListener);

//  lblScrLock = new gcn::Label("ScrollLock LED:");
//  lblScrLock->setSize(100, LABEL_HEIGHT);
//  lblScrLock->setAlignment(gcn::Graphics::RIGHT);
//  cboKBDLed_scr = new gcn::UaeDropDown(&KBDLedList);
//  cboKBDLed_scr->setSize(150, DROPDOWN_HEIGHT);
//  cboKBDLed_scr->setBaseColor(gui_baseCol);
//  cboKBDLed_scr->setId("scrolllock");
//  cboKBDLed_scr->addActionListener(gameportActionListener);

  int posY = DISTANCE_BORDER;
  category.panel->add(lblPort0, DISTANCE_BORDER, posY);
  category.panel->add(cboPorts[0], DISTANCE_BORDER + lblPort0->getWidth() + 8, posY);
  category.panel->add(cboPortModes[0], cboPorts[0]->getX() + cboPorts[0]->getWidth() + 8, posY);
  category.panel->add(cboAutofires[0], cboPortModes[0]->getX() + cboPortModes[0]->getWidth() + 8, posY);
  posY += cboPorts[0]->getHeight() + DISTANCE_NEXT_Y;
  category.panel->add(lblPort1, DISTANCE_BORDER, posY);
  category.panel->add(cboPorts[1], DISTANCE_BORDER + lblPort1->getWidth() + 8, posY);
  category.panel->add(cboPortModes[1], cboPorts[1]->getX() + cboPorts[1]->getWidth() + 8, posY);
  category.panel->add(cboAutofires[1], cboPortModes[1]->getX() + cboPortModes[1]->getWidth() + 8, posY);
  posY += cboPorts[1]->getHeight() + DISTANCE_NEXT_Y;

  category.panel->add(lblPort2, DISTANCE_BORDER, posY);
  category.panel->add(cboPorts[2], DISTANCE_BORDER + lblPort2->getWidth() + 8, posY);
  posY += cboPorts[2]->getHeight() + DISTANCE_NEXT_Y;
  category.panel->add(lblPort3, DISTANCE_BORDER, posY);
  category.panel->add(cboPorts[3], DISTANCE_BORDER + lblPort3->getWidth() + 8, posY);
  posY += cboPorts[3]->getHeight() + DISTANCE_NEXT_Y;

  category.panel->add(lblMouseSpeed, DISTANCE_BORDER, posY);
  category.panel->add(sldMouseSpeed, DISTANCE_BORDER + lblMouseSpeed->getWidth() + 9, posY);
  category.panel->add(lblMouseSpeedInfo, sldMouseSpeed->getX() + sldMouseSpeed->getWidth() + 12, posY);
  category.panel->add(lblAutofireRate, 300, posY);
  category.panel->add(sldAutofireRate, 300 + lblAutofireRate->getWidth() + 9, posY);
  category.panel->add(lblAutofireRateInfo, sldAutofireRate->getX() + sldAutofireRate->getWidth() + 12, posY);
  posY += sldAutofireRate->getHeight() + DISTANCE_NEXT_Y;

//  category.panel->add(lblNumLock, DISTANCE_BORDER, posY);
//	category.panel->add(cboKBDLed_num, DISTANCE_BORDER + lblNumLock->getWidth() + 8, posY);
//  category.panel->add(lblCapLock, lblNumLock->getX() + lblNumLock->getWidth() + DISTANCE_NEXT_X, posY);
//  category.panel->add(cboKBDLed_cap, cboKBDLed_num->getX() + cboKBDLed_num->getWidth() + DISTANCE_NEXT_X, posY);
//	category.panel->add(lblScrLock, cboKBDLed_num->getX() + cboKBDLed_num->getWidth() + DISTANCE_NEXT_X, posY);
//	category.panel->add(cboKBDLed_scr, lblScrLock->getX() + lblScrLock->getWidth() + 8, posY);
//  posY += cboKBDLed_scr->getHeight() + DISTANCE_NEXT_Y;

  values_to_dialog();
}
示例#5
0
文件: rp.cpp 项目: biglad/WinUAE
int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TCHAR *custom)
{
	const TCHAR *p = custom;
	int mode, *events, *axistable;
	int max, evtnum;
	int kb;
	const TCHAR **eventorder;

	eventorder = getcustomeventorder (&devicetype);
	if (!eventorder)
		return FALSE;

	kb = inputdevice_get_device_total (IDTYPE_JOYSTICK) + inputdevice_get_device_total (IDTYPE_MOUSE);

	inputdevice_updateconfig_internal (&changed_prefs);
	inputdevice_compa_prepare_custom (&changed_prefs, inputmap_port, devicetype);
	inputdevice_updateconfig_internal (&changed_prefs);
	max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable);
	write_log (_T("custom='%s' max=%d port=%d dt=%d kb=%d kbnum=%d\n"), custom, max, inputmap_port, devicetype, kb, inputdevice_get_device_total (IDTYPE_KEYBOARD));
	if (!max)
		return FALSE;

	while (p && p[0]) {
		int idx = -1, kc = -1;
		int flags = 0;
		int eventlen;

		const TCHAR *p2 = _tcschr (p, '=');
		if (!p2)
			break;
		const TCHAR *p4 = p;
		eventlen = -1;
		for (;;) {
			const TCHAR *p3 = _tcschr (p4, '.');
			if (!p3 || p3 >= p2) {
				p3 = NULL;
				if (eventlen < 0)
					eventlen = p2 - p;
				break;
			}
			if (eventlen < 0)
				eventlen = p3 - p;
			if (!_tcsnicmp (p3 + 1, L"autorepeat", 10))
				flags |= IDEV_MAPPED_AUTOFIRE_SET;
			p4 = p3 + 1;
		}
		
		for (int i = 0; eventorder[i]; i++) {
			if (_tcslen (eventorder[i]) == eventlen && !_tcsncmp (p, eventorder[i], eventlen)) {
				idx = i;
				break;
			}
		}
		p2++;
		if (p2[0] == '0' && (p2[1] == 'x' || p2[1] == 'X'))
			kc = _tcstol (p2 + 2, NULL, 16);
		else
			kc = _tstol (p2);
		p = _tcschr (p2, ' ');
		if (p)
			p++;

		if (idx < 0)
			continue;
		if (kc < 0)
			continue;

		evtnum = events[idx];

		write_log (_T("kb=%d evt=%d kc=%02x flags=%08x\n"), kb, evtnum, kc, flags);

		for (int j = 0; j < inputdevice_get_device_total (IDTYPE_KEYBOARD); j++) {
			int wdnum = -1;
			for (int i = 0; i < inputdevicefunc_keyboard.get_widget_num (j); i++) {
				uae_u32 kc2 = 0;
				inputdevicefunc_keyboard.get_widget_type (j, i, NULL, &kc2);
				if (kc == kc2) {
					wdnum = i;
					break;
				}
			}
			if (wdnum >= 0) {
				//write_log (_T("kb=%d (%s) wdnum=%d\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), wdnum);
				inputdevice_set_gameports_mapping (&changed_prefs, kb + j, wdnum, evtnum, flags, inputmap_port);
				inputdevice_set_gameports_mapping (&currprefs, kb + j, wdnum, evtnum, flags, inputmap_port);
			} else {
				write_log (_T("kb=%d (%): keycode %02x not found!\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), kc);
			}
		}
	}

	inputdevice_updateconfig_internal (&changed_prefs);
	inputdevice_updateconfig (&currprefs);
	return TRUE;
}
示例#6
0
void InitPanelInput(const struct _ConfigCategory& category)
{
  inputActionListener = new InputActionListener();

  if (ctrlPortList.getNumberOfElements() < (4 + inputdevice_get_device_total (IDTYPE_JOYSTICK)))
  {
    int i;
    for(i=0; i<(inputdevice_get_device_total (IDTYPE_JOYSTICK) - 1); i++)
    {
       ctrlPortList.AddElement(inputdevice_get_device_name(IDTYPE_JOYSTICK,i + 1));
    }
  }


  lblPort0 = new gcn::Label("Port0:");
  lblPort0->setSize(100, LABEL_HEIGHT);
  lblPort0->setAlignment(gcn::Graphics::RIGHT);
	cboPort0 = new gcn::UaeDropDown(&ctrlPortList);
  cboPort0->setSize(435, DROPDOWN_HEIGHT);
  cboPort0->setBaseColor(gui_baseCol);
  cboPort0->setId("cboPort0");
  cboPort0->addActionListener(inputActionListener);

  lblPort1 = new gcn::Label("Port1:");
  lblPort1->setSize(100, LABEL_HEIGHT);
  lblPort1->setAlignment(gcn::Graphics::RIGHT);
	cboPort1 = new gcn::UaeDropDown(&ctrlPortList);
  cboPort1->setSize(435, DROPDOWN_HEIGHT);
  cboPort1->setBaseColor(gui_baseCol);
  cboPort1->setId("cboPort1");
  cboPort1->addActionListener(inputActionListener);

  lblAutofire = new gcn::Label("Autofire Rate:");
  lblAutofire->setSize(100, LABEL_HEIGHT);
  lblAutofire->setAlignment(gcn::Graphics::RIGHT);
	cboAutofire = new gcn::UaeDropDown(&autofireList);
  cboAutofire->setSize(80, DROPDOWN_HEIGHT);
  cboAutofire->setBaseColor(gui_baseCol);
  cboAutofire->setId("cboAutofire");
  cboAutofire->addActionListener(inputActionListener);

	lblMouseSpeed = new gcn::Label("Mouse Speed:");
  lblMouseSpeed->setSize(100, LABEL_HEIGHT);
  lblMouseSpeed->setAlignment(gcn::Graphics::RIGHT);
  sldMouseSpeed = new gcn::Slider(0, 4);
  sldMouseSpeed->setSize(110, SLIDER_HEIGHT);
  sldMouseSpeed->setBaseColor(gui_baseCol);
	sldMouseSpeed->setMarkerLength(20);
	sldMouseSpeed->setStepLength(1);
	sldMouseSpeed->setId("MouseSpeed");
  sldMouseSpeed->addActionListener(inputActionListener);
  lblMouseSpeedInfo = new gcn::Label(".25");
#ifndef RASPBERRY
  lblTapDelay = new gcn::Label("Tap Delay:");
  lblTapDelay->setSize(100, LABEL_HEIGHT);
  lblTapDelay->setAlignment(gcn::Graphics::RIGHT);
	cboTapDelay = new gcn::UaeDropDown(&tapDelayList);
  cboTapDelay->setSize(80, DROPDOWN_HEIGHT);
  cboTapDelay->setBaseColor(gui_baseCol);
  cboTapDelay->setId("cboTapDelay");
  cboTapDelay->addActionListener(inputActionListener);
  
  chkMouseHack = new gcn::UaeCheckBox("Enable mousehack");
  chkMouseHack->setId("MouseHack");
  chkMouseHack->addActionListener(inputActionListener);
#endif
	chkCustomCtrl = new gcn::UaeCheckBox("Custom Control");
	chkCustomCtrl->setId("CustomCtrl");
  chkCustomCtrl->addActionListener(inputActionListener);

  lblA = new gcn::Label("<A>:");
  lblA->setSize(100, LABEL_HEIGHT);
  lblA->setAlignment(gcn::Graphics::RIGHT);
	cboA = new gcn::UaeDropDown(&mappingList);
  cboA->setSize(150, DROPDOWN_HEIGHT);
  cboA->setBaseColor(gui_baseCol);
  cboA->setId("cboA");
  cboA->addActionListener(inputActionListener);

  lblB = new gcn::Label("<B>:");
  lblB->setSize(100, LABEL_HEIGHT);
  lblB->setAlignment(gcn::Graphics::RIGHT);
	cboB = new gcn::UaeDropDown(&mappingList);
  cboB->setSize(150, DROPDOWN_HEIGHT);
  cboB->setBaseColor(gui_baseCol);
  cboB->setId("cboB");
  cboB->addActionListener(inputActionListener);

  lblX = new gcn::Label("<X>:");
  lblX->setSize(100, LABEL_HEIGHT);
  lblX->setAlignment(gcn::Graphics::RIGHT);
	cboX = new gcn::UaeDropDown(&mappingList);
  cboX->setSize(150, DROPDOWN_HEIGHT);
  cboX->setBaseColor(gui_baseCol);
  cboX->setId("cboX");
  cboX->addActionListener(inputActionListener);

  lblY = new gcn::Label("<Y>:");
  lblY->setSize(100, LABEL_HEIGHT);
  lblY->setAlignment(gcn::Graphics::RIGHT);
	cboY = new gcn::UaeDropDown(&mappingList);
  cboY->setSize(150, DROPDOWN_HEIGHT);
  cboY->setBaseColor(gui_baseCol);
  cboY->setId("cboY");
  cboY->addActionListener(inputActionListener);

  lblL = new gcn::Label("<L>:");
  lblL->setSize(100, LABEL_HEIGHT);
  lblL->setAlignment(gcn::Graphics::RIGHT);
	cboL = new gcn::UaeDropDown(&mappingList);
  cboL->setSize(150, DROPDOWN_HEIGHT);
  cboL->setBaseColor(gui_baseCol);
  cboL->setId("cboL");
  cboL->addActionListener(inputActionListener);

  lblR = new gcn::Label("<R>:");
  lblR->setSize(100, LABEL_HEIGHT);
  lblR->setAlignment(gcn::Graphics::RIGHT);
	cboR = new gcn::UaeDropDown(&mappingList);
  cboR->setSize(150, DROPDOWN_HEIGHT);
  cboR->setBaseColor(gui_baseCol);
  cboR->setId("cboR");
  cboR->addActionListener(inputActionListener);

  lblUp = new gcn::Label("Up:");
  lblUp->setSize(100, LABEL_HEIGHT);
  lblUp->setAlignment(gcn::Graphics::RIGHT);
	cboUp = new gcn::UaeDropDown(&mappingList);
  cboUp->setSize(150, DROPDOWN_HEIGHT);
  cboUp->setBaseColor(gui_baseCol);
  cboUp->setId("cboUp");
  cboUp->addActionListener(inputActionListener);

  lblDown = new gcn::Label("Down:");
  lblDown->setSize(100, LABEL_HEIGHT);
  lblDown->setAlignment(gcn::Graphics::RIGHT);
	cboDown = new gcn::UaeDropDown(&mappingList);
  cboDown->setSize(150, DROPDOWN_HEIGHT);
  cboDown->setBaseColor(gui_baseCol);
  cboDown->setId("cboDown");
  cboDown->addActionListener(inputActionListener);

  lblLeft = new gcn::Label("Left:");
  lblLeft->setSize(100, LABEL_HEIGHT);
  lblLeft->setAlignment(gcn::Graphics::RIGHT);
	cboLeft = new gcn::UaeDropDown(&mappingList);
  cboLeft->setSize(150, DROPDOWN_HEIGHT);
  cboLeft->setBaseColor(gui_baseCol);
  cboLeft->setId("cboLeft");
  cboLeft->addActionListener(inputActionListener);

  lblRight = new gcn::Label("Right:");
  lblRight->setSize(100, LABEL_HEIGHT);
  lblRight->setAlignment(gcn::Graphics::RIGHT);
	cboRight = new gcn::UaeDropDown(&mappingList);
  cboRight->setSize(150, DROPDOWN_HEIGHT);
  cboRight->setBaseColor(gui_baseCol);
  cboRight->setId("cboRight");
  cboRight->addActionListener(inputActionListener);

  lblKeyForMenu = new gcn::Label("Key for Menu:");
  lblKeyForMenu->setSize(100, LABEL_HEIGHT);
  lblKeyForMenu->setAlignment(gcn::Graphics::RIGHT);
  KeyForMenu = new gcn::UaeDropDown(&ControlKeyList);
  KeyForMenu->setSize(150, DROPDOWN_HEIGHT);
  KeyForMenu->setBaseColor(gui_baseCol);
  KeyForMenu->setId("CKeyMenu");
  KeyForMenu->addActionListener(inputActionListener);

  int posY = DISTANCE_BORDER;
  category.panel->add(lblPort0, DISTANCE_BORDER, posY);
  category.panel->add(cboPort0, DISTANCE_BORDER + lblPort0->getWidth() + 8, posY);
  posY += cboPort0->getHeight() + DISTANCE_NEXT_Y;
  category.panel->add(lblPort1, DISTANCE_BORDER, posY);
  category.panel->add(cboPort1, DISTANCE_BORDER + lblPort1->getWidth() + 8, posY);

  posY += cboPort1->getHeight() + DISTANCE_NEXT_Y;
  category.panel->add(lblAutofire, DISTANCE_BORDER, posY);
  category.panel->add(cboAutofire, DISTANCE_BORDER + lblAutofire->getWidth() + 8, posY);
  posY += cboAutofire->getHeight() + DISTANCE_NEXT_Y;

  category.panel->add(lblMouseSpeed, DISTANCE_BORDER, posY);
  category.panel->add(sldMouseSpeed, DISTANCE_BORDER + lblMouseSpeed->getWidth() + 8, posY);
  category.panel->add(lblMouseSpeedInfo, sldMouseSpeed->getX() + sldMouseSpeed->getWidth() + 12, posY);
  posY += sldMouseSpeed->getHeight() + DISTANCE_NEXT_Y;
#ifndef RASPBERRY
  category.panel->add(chkMouseHack, DISTANCE_BORDER + lblA->getWidth() + 8, posY);
  category.panel->add(lblTapDelay, 300, posY);
  category.panel->add(cboTapDelay, 300 + lblTapDelay->getWidth() + 8, posY);
  posY += cboTapDelay->getHeight() + DISTANCE_NEXT_Y;
#endif
  category.panel->add(chkCustomCtrl, DISTANCE_BORDER + lblA->getWidth() + 8, posY);
  posY += chkCustomCtrl->getHeight() + DISTANCE_NEXT_Y;
  category.panel->add(lblA, DISTANCE_BORDER, posY);
  category.panel->add(cboA, DISTANCE_BORDER + lblA->getWidth() + 8, posY);
  category.panel->add(lblB, 300, posY);
  category.panel->add(cboB, 300 + lblB->getWidth() + 8, posY);
  posY += cboA->getHeight() + 4;
  category.panel->add(lblX, DISTANCE_BORDER, posY);
  category.panel->add(cboX, DISTANCE_BORDER + lblX->getWidth() + 8, posY);
  category.panel->add(lblY, 300, posY);
  category.panel->add(cboY, 300 + lblY->getWidth() + 8, posY);
  posY += cboX->getHeight() + 4;
  category.panel->add(lblL, DISTANCE_BORDER, posY);
  category.panel->add(cboL, DISTANCE_BORDER + lblL->getWidth() + 8, posY);
  category.panel->add(lblR, 300, posY);
  category.panel->add(cboR, 300 + lblR->getWidth() + 8, posY);
  posY += cboL->getHeight() + 4;
  category.panel->add(lblUp, DISTANCE_BORDER, posY);
  category.panel->add(cboUp, DISTANCE_BORDER + lblUp->getWidth() + 8, posY);
  category.panel->add(lblDown, 300, posY);
  category.panel->add(cboDown, 300 + lblDown->getWidth() + 8, posY);
  posY += cboUp->getHeight() + 4;
  category.panel->add(lblLeft, DISTANCE_BORDER, posY);
  category.panel->add(cboLeft, DISTANCE_BORDER + lblLeft->getWidth() + 8, posY);
  category.panel->add(lblRight, 300, posY);
  category.panel->add(cboRight, 300 + lblRight->getWidth() + 8, posY);
  posY += cboLeft->getHeight() + DISTANCE_NEXT_Y;
  
  category.panel->add(lblKeyForMenu, DISTANCE_BORDER, posY);
  category.panel->add(KeyForMenu, DISTANCE_BORDER + lblLeft->getWidth() + 8, posY);
  posY += KeyForMenu->getHeight() + 4;

  RefreshPanelInput();
}