Search
lxdream.org :: lxdream/src/maple/controller.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/maple/controller.c
changeset 451:50622730f226
prev450:207461e79f21
next460:a0c865b74c63
author nkeynes
date Sun Oct 21 05:15:56 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Unregister keys on controller detach
file annotate diff log raw
1.1 --- a/src/maple/controller.c Wed Oct 17 11:26:45 2007 +0000
1.2 +++ b/src/maple/controller.c Sun Oct 21 05:15:56 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: controller.c,v 1.7 2007-10-17 11:26:45 nkeynes Exp $
1.6 + * $Id: controller.c,v 1.8 2007-10-21 05:15:56 nkeynes Exp $
1.7 *
1.8 * Implements the standard dreamcast controller
1.9 *
1.10 @@ -154,8 +154,24 @@
1.11 input_register_key( dev->config[14].value, controller_key_callback, dev, BUTTON_START );
1.12 }
1.13
1.14 -void controller_detach( maple_device_t dev )
1.15 +void controller_detach( maple_device_t mdev )
1.16 {
1.17 + controller_device_t dev = (controller_device_t)mdev;
1.18 + input_unregister_key( dev->config[0].value, controller_key_callback, dev, BUTTON_DPAD_LEFT );
1.19 + input_unregister_key( dev->config[1].value, controller_key_callback, dev, BUTTON_DPAD_RIGHT );
1.20 + input_unregister_key( dev->config[2].value, controller_key_callback, dev, BUTTON_DPAD_UP );
1.21 + input_unregister_key( dev->config[3].value, controller_key_callback, dev, BUTTON_DPAD_DOWN );
1.22 + input_unregister_key( dev->config[4].value, controller_key_callback, dev, JOY_LEFT );
1.23 + input_unregister_key( dev->config[5].value, controller_key_callback, dev, JOY_RIGHT );
1.24 + input_unregister_key( dev->config[6].value, controller_key_callback, dev, JOY_UP );
1.25 + input_unregister_key( dev->config[7].value, controller_key_callback, dev, JOY_DOWN );
1.26 + input_unregister_key( dev->config[8].value, controller_key_callback, dev, BUTTON_X );
1.27 + input_unregister_key( dev->config[9].value, controller_key_callback, dev, BUTTON_Y );
1.28 + input_unregister_key( dev->config[10].value, controller_key_callback, dev, BUTTON_A );
1.29 + input_unregister_key( dev->config[11].value, controller_key_callback, dev, BUTTON_B );
1.30 + input_unregister_key( dev->config[12].value, controller_key_callback, dev, BUTTON_LEFT_TRIGGER );
1.31 + input_unregister_key( dev->config[13].value, controller_key_callback, dev, BUTTON_RIGHT_TRIGGER );
1.32 + input_unregister_key( dev->config[14].value, controller_key_callback, dev, BUTTON_START );
1.33
1.34 }
1.35
.