forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 2
/
input_driver.h
860 lines (701 loc) · 25 KB
/
input_driver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INPUT_DRIVER__H
#define __INPUT_DRIVER__H
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
#include "input_types.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <boolean.h>
#include <retro_common_api.h>
#include <retro_inline.h>
#include <libretro.h>
#include <retro_miscellaneous.h>
#include "input_defines.h"
#include "../msg_hash.h"
#include "include/hid_types.h"
#include "include/hid_driver.h"
#include "include/gamepad.h"
RETRO_BEGIN_DECLS
enum input_device_type
{
INPUT_DEVICE_TYPE_NONE = 0,
INPUT_DEVICE_TYPE_KEYBOARD,
INPUT_DEVICE_TYPE_JOYPAD
};
enum input_toggle_type
{
INPUT_TOGGLE_NONE = 0,
INPUT_TOGGLE_DOWN_Y_L_R,
INPUT_TOGGLE_L3_R3,
INPUT_TOGGLE_L1_R1_START_SELECT,
INPUT_TOGGLE_START_SELECT,
INPUT_TOGGLE_L3_R,
INPUT_TOGGLE_L_R,
INPUT_TOGGLE_HOLD_START,
INPUT_TOGGLE_DOWN_SELECT,
INPUT_TOGGLE_LAST
};
enum input_action
{
INPUT_ACTION_NONE = 0,
INPUT_ACTION_AXIS_THRESHOLD,
INPUT_ACTION_MAX_USERS
};
enum rarch_input_keyboard_ctl_state
{
RARCH_INPUT_KEYBOARD_CTL_NONE = 0,
RARCH_INPUT_KEYBOARD_CTL_SET_LINEFEED_ENABLED,
RARCH_INPUT_KEYBOARD_CTL_UNSET_LINEFEED_ENABLED,
RARCH_INPUT_KEYBOARD_CTL_IS_LINEFEED_ENABLED,
RARCH_INPUT_KEYBOARD_CTL_LINE_FREE,
/*
* Waits for keys to be pressed (used for binding
* keys in the menu).
* Callback returns false when all polling is done.
**/
RARCH_INPUT_KEYBOARD_CTL_START_WAIT_KEYS,
/* Cancels keyboard wait for keys function callback. */
RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS
};
struct retro_keybind
{
bool valid;
uint16_t id;
enum msg_hash_enums enum_idx;
enum retro_key key;
uint16_t mbutton;
/* Joypad key. Joypad POV (hats)
* are embedded into this key as well. */
uint16_t joykey;
/* Default key binding value -
* for resetting bind to default */
uint16_t def_joykey;
/* Joypad axis. Negative and positive axes
* are embedded into this variable. */
uint32_t joyaxis;
/* Default joy axis binding value -
* for resetting bind to default */
uint32_t def_joyaxis;
/* Used by input_{push,pop}_analog_dpad(). */
uint32_t orig_joyaxis;
char *joykey_label;
char *joyaxis_label;
};
struct rarch_joypad_info
{
uint16_t joy_idx;
const struct retro_keybind *auto_binds;
float axis_threshold;
};
struct input_driver
{
/* Inits input driver.
*/
void *(*init)(const char *joypad_driver);
/* Polls input. Called once every frame. */
void (*poll)(void *data);
/* Queries input state for a certain key on a certain player.
* Players are 1 - MAX_USERS.
* For digital inputs, pressed key is 1, not pressed key is 0.
* Analog values have same range as a signed 16-bit integer.
*/
int16_t (*input_state)(void *data,
rarch_joypad_info_t joypad_info,
const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id);
/* Frees the input struct. */
void (*free)(void *data);
bool (*set_sensor_state)(void *data, unsigned port,
enum retro_sensor_action action, unsigned rate);
float (*get_sensor_input)(void *data, unsigned port, unsigned id);
uint64_t (*get_capabilities)(void *data);
const char *ident;
void (*grab_mouse)(void *data, bool state);
bool (*grab_stdin)(void *data);
bool (*set_rumble)(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t state);
const input_device_driver_t *(*get_joypad_driver)(void *data);
const input_device_driver_t *(*get_sec_joypad_driver)(void *data);
bool (*keyboard_mapping_is_blocked)(void *data);
void (*keyboard_mapping_set_block)(void *data, bool value);
};
struct rarch_joypad_driver
{
bool (*init)(void *data);
bool (*query_pad)(unsigned);
void (*destroy)(void);
bool (*button)(unsigned, uint16_t);
void (*get_buttons)(unsigned, input_bits_t *);
int16_t (*axis)(unsigned, uint32_t);
void (*poll)(void);
bool (*set_rumble)(unsigned, enum retro_rumble_effect, uint16_t);
const char *(*name)(unsigned);
const char *ident;
};
/**
* input_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to input driver at index. Can be NULL
* if nothing found.
**/
const void *input_driver_find_handle(int index);
/**
* input_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of input driver at index. Can be NULL
* if nothing found.
**/
const char *input_driver_find_ident(int index);
/**
* config_get_input_driver_options:
*
* Get an enumerated list of all input driver names, separated by '|'.
*
* Returns: string listing of all input driver names, separated by '|'.
**/
const char* config_get_input_driver_options(void);
/**
* input_driver_set_rumble_state:
* @port : User number.
* @effect : Rumble effect.
* @strength : Strength of rumble effect.
*
* Sets the rumble state.
* Used by RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE.
**/
bool input_driver_set_rumble_state(unsigned port,
enum retro_rumble_effect effect, uint16_t strength);
uint64_t input_driver_get_capabilities(void);
const input_device_driver_t * input_driver_get_joypad_driver(void);
const input_device_driver_t * input_driver_get_sec_joypad_driver(void);
void input_driver_keyboard_mapping_set_block(bool value);
void input_driver_set(const input_driver_t **input, void **input_data);
/**
* input_sensor_set_state:
* @port : User number.
* @effect : Sensor action.
* @rate : Sensor rate update.
*
* Sets the sensor state.
* Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE.
**/
bool input_sensor_set_state(unsigned port,
enum retro_sensor_action action, unsigned rate);
float input_sensor_get_input(unsigned port, unsigned id);
#define inherit_joyaxis(binds) (((binds)[x_plus].joyaxis == (binds)[x_minus].joyaxis) || ( (binds)[y_plus].joyaxis == (binds)[y_minus].joyaxis))
/**
* input_pop_analog_dpad:
* @binds : Binds to modify.
*
* Restores binds temporarily overridden by input_push_analog_dpad().
**/
#define input_pop_analog_dpad(binds) \
{ \
unsigned j; \
for (j = RETRO_DEVICE_ID_JOYPAD_UP; j <= RETRO_DEVICE_ID_JOYPAD_RIGHT; j++) \
(binds)[j].joyaxis = (binds)[j].orig_joyaxis; \
}
/**
* input_push_analog_dpad:
* @binds : Binds to modify.
* @mode : Which analog stick to bind D-Pad to.
* E.g:
* ANALOG_DPAD_LSTICK
* ANALOG_DPAD_RSTICK
*
* Push analog to D-Pad mappings to binds.
**/
#define input_push_analog_dpad(binds, mode) \
{ \
unsigned k; \
unsigned x_plus = RARCH_ANALOG_RIGHT_X_PLUS; \
unsigned y_plus = RARCH_ANALOG_RIGHT_Y_PLUS; \
unsigned x_minus = RARCH_ANALOG_RIGHT_X_MINUS; \
unsigned y_minus = RARCH_ANALOG_RIGHT_Y_MINUS; \
if ((mode) == ANALOG_DPAD_LSTICK) \
{ \
x_plus = RARCH_ANALOG_LEFT_X_PLUS; \
y_plus = RARCH_ANALOG_LEFT_Y_PLUS; \
x_minus = RARCH_ANALOG_LEFT_X_MINUS; \
y_minus = RARCH_ANALOG_LEFT_Y_MINUS; \
} \
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \
(binds)[k].orig_joyaxis = (binds)[k].joyaxis; \
if (!inherit_joyaxis(binds)) \
{ \
unsigned j = x_plus + 3; \
/* Inherit joyaxis from analogs. */ \
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \
(binds)[k].joyaxis = (binds)[j--].joyaxis; \
} \
}
/**
* input_poll:
*
* Input polling callback function.
**/
void input_poll(void);
/**
* input_state:
* @port : user number.
* @device : device identifier of user.
* @idx : index value of user.
* @id : identifier of key pressed by user.
*
* Input state callback function.
*
* Returns: Non-zero if the given key (identified by @id) was pressed by the user
* (assigned to @port).
**/
int16_t input_state(unsigned port, unsigned device,
unsigned idx, unsigned id);
void input_keys_pressed(void *data, input_bits_t* new_state);
#ifdef HAVE_MENU
void input_menu_keys_pressed(void *data, input_bits_t* new_state);
#endif
void *input_driver_get_data(void);
void input_get_state_for_port(void *data, unsigned port, input_bits_t *p_new_state);
const input_driver_t *input_get_ptr(void);
void *input_get_data(void);
const input_driver_t **input_get_double_ptr(void);
void **input_driver_get_data_ptr(void);
bool input_driver_has_capabilities(void);
bool input_driver_init(void);
void input_driver_deinit(void);
void input_driver_destroy_data(void);
void input_driver_destroy(void);
bool input_driver_grab_stdin(void);
bool input_driver_keyboard_mapping_is_blocked(void);
bool input_driver_find_driver(void);
void input_driver_set_flushing_input(void);
void input_driver_unset_hotkey_block(void);
void input_driver_set_hotkey_block(void);
void input_driver_set_libretro_input_blocked(void);
void input_driver_unset_libretro_input_blocked(void);
bool input_driver_is_libretro_input_blocked(void);
void input_driver_set_nonblock_state(void);
void input_driver_unset_nonblock_state(void);
bool input_driver_is_nonblock_state(void);
void input_driver_set_own_driver(void);
void input_driver_unset_own_driver(void);
bool input_driver_owns_driver(void);
void input_driver_deinit_command(void);
bool input_driver_init_command(void);
void input_driver_deinit_remote(void);
bool input_driver_init_remote(void);
void input_driver_deinit_mapper(void);
bool input_driver_init_mapper(void);
bool input_driver_grab_mouse(void);
bool input_driver_ungrab_mouse(void);
int16_t input_driver_input_state(
rarch_joypad_info_t joypad_info,
const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id);
float *input_driver_get_float(enum input_action action);
unsigned *input_driver_get_uint(enum input_action action);
bool input_driver_is_data_ptr_same(void *data);
/**
* joypad_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to joypad driver at index. Can be NULL
* if nothing found.
**/
const void *joypad_driver_find_handle(int index);
/**
* joypad_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of joypad driver at index. Can be NULL
* if nothing found.
**/
const char *joypad_driver_find_ident(int index);
/**
* config_get_joypad_driver_options:
*
* Get an enumerated list of all joypad driver names, separated by '|'.
*
* Returns: string listing of all joypad driver names, separated by '|'.
**/
const char* config_get_joypad_driver_options(void);
/**
* input_joypad_init_driver:
* @ident : identifier of driver to initialize.
*
* Initialize a joypad driver of name @ident.
*
* If ident points to NULL or a zero-length string,
* equivalent to calling input_joypad_init_first().
*
* Returns: joypad driver if found, otherwise NULL.
**/
const input_device_driver_t *input_joypad_init_driver(const char *ident, void *data);
/**
* input_joypad_init_first:
*
* Finds first suitable joypad driver and initializes.
*
* Returns: joypad driver if found, otherwise NULL.
**/
const input_device_driver_t *input_joypad_init_first(void *data);
/**
* input_conv_analog_id_to_bind_id:
* @idx : Analog key index.
* E.g.:
* - RETRO_DEVICE_INDEX_ANALOG_LEFT
* - RETRO_DEVICE_INDEX_ANALOG_RIGHT
* @ident : Analog key identifier.
* E.g.:
* - RETRO_DEVICE_ID_ANALOG_X
* - RETRO_DEVICE_ID_ANALOG_Y
* @ident_minus : Bind ID minus, will be set by function.
* @ident_plus : Bind ID plus, will be set by function.
*
* Takes as input analog key identifiers and converts
* them to corresponding bind IDs @ident_minus and @ident_plus.
**/
void input_conv_analog_id_to_bind_id(unsigned idx, unsigned ident,
unsigned *ident_minus, unsigned *ident_plus);
/**
* input_joypad_pressed:
* @drv : Input device driver handle.
* @port : User number.
* @binds : Binds of user.
* @key : Identifier of key.
*
* Checks if key (@key) was being pressed by user
* with number @port with provided keybinds (@binds).
*
* Returns: true (1) if key was pressed, otherwise
* false (0).
**/
static INLINE bool input_joypad_pressed(
const input_device_driver_t *drv,
rarch_joypad_info_t joypad_info,
unsigned port,
const struct retro_keybind *binds,
unsigned key)
{
/* Auto-binds are per joypad, not per user. */
const uint64_t joykey = (binds[key].joykey != NO_BTN)
? binds[key].joykey : joypad_info.auto_binds[key].joykey;
const uint32_t joyaxis = (binds[key].joyaxis != AXIS_NONE)
? binds[key].joyaxis : joypad_info.auto_binds[key].joyaxis;
if ((uint16_t)joykey != NO_BTN && drv->button(joypad_info.joy_idx, (uint16_t)joykey))
return true;
return ((float)abs(drv->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold;
}
/**
* input_joypad_analog:
* @drv : Input device driver handle.
* @port : User number.
* @idx : Analog key index.
* E.g.:
* - RETRO_DEVICE_INDEX_ANALOG_LEFT
* - RETRO_DEVICE_INDEX_ANALOG_RIGHT
* - RETRO_DEVICE_INDEX_ANALOG_BUTTON
* @ident : Analog key identifier.
* E.g.:
* - RETRO_DEVICE_ID_ANALOG_X
* - RETRO_DEVICE_ID_ANALOG_Y
* @binds : Binds of user.
*
* Gets analog value of analog key identifiers @idx and @ident
* from user with number @port with provided keybinds (@binds).
*
* Returns: analog value on success, otherwise 0.
**/
int16_t input_joypad_analog(const input_device_driver_t *driver,
rarch_joypad_info_t joypad_info,
unsigned port, unsigned idx, unsigned ident,
const struct retro_keybind *binds);
/**
* input_joypad_set_rumble:
* @drv : Input device driver handle.
* @port : User number.
* @effect : Rumble effect to set.
* @strength : Strength of rumble effect.
*
* Sets rumble effect @effect with strength @strength.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool input_joypad_set_rumble(const input_device_driver_t *driver,
unsigned port, enum retro_rumble_effect effect, uint16_t strength);
/**
* input_joypad_axis_raw:
* @drv : Input device driver handle.
* @port : Joystick number.
* @axis : Identifier of axis.
*
* Checks if axis (@axis) was being pressed by user
* with joystick number @port.
*
* Returns: true (1) if axis was pressed, otherwise
* false (0).
**/
int16_t input_joypad_axis_raw(const input_device_driver_t *driver,
unsigned port, unsigned axis);
/**
* input_joypad_button_raw:
* @drv : Input device driver handle.
* @port : Joystick number.
* @button : Identifier of key.
*
* Checks if key (@button) was being pressed by user
* with joystick number @port.
*
* Returns: true (1) if key was pressed, otherwise
* false (0).
**/
bool input_joypad_button_raw(const input_device_driver_t *driver,
unsigned port, unsigned button);
bool input_joypad_hat_raw(const input_device_driver_t *driver,
unsigned joypad, unsigned hat_dir, unsigned hat);
/**
* input_pad_connect:
* @port : Joystick number.
* @driver : handle for joypad driver handling joystick's input
*
* Registers a newly connected pad with RetroArch.
**/
void input_pad_connect(unsigned port, input_device_driver_t *driver);
/**
* input_mouse_button_raw:
* @port : Mouse number.
* @button : Identifier of key (libretro mouse constant).
*
* Checks if key (@button) was being pressed by user
* with mouse number @port.
*
* Returns: true (1) if key was pressed, otherwise
* false (0).
**/
bool input_mouse_button_raw(unsigned port, unsigned button);
/**
* input_joypad_name:
* @drv : Input device driver handle.
* @port : Joystick number.
*
* Gets name of the joystick (@port).
*
* Returns: name of joystick #port.
**/
const char *input_joypad_name(const input_device_driver_t *driver,
unsigned port);
bool input_config_get_bind_idx(unsigned port, unsigned *joy_idx_real);
#ifdef HAVE_HID
#include "include/hid_driver.h"
/**
* hid_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to HID driver at index. Can be NULL
* if nothing found.
**/
const void *hid_driver_find_handle(int index);
/**
* hid_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of HID driver at index. Can be NULL
* if nothing found.
**/
const char *hid_driver_find_ident(int index);
/**
* config_get_hid_driver_options:
*
* Get an enumerated list of all HID driver names, separated by '|'.
*
* Returns: string listing of all HID driver names, separated by '|'.
**/
const char* config_get_hid_driver_options(void);
/**
* input_hid_init_first:
*
* Finds first suitable HID driver and initializes.
*
* Returns: HID driver if found, otherwise NULL.
**/
const hid_driver_t *input_hid_init_first(void);
const void *hid_driver_get_data(void);
void hid_driver_reset_data(void);
#endif
/** Line complete callback.
* Calls back after return is pressed with the completed line.
* Line can be NULL.
**/
typedef void (*input_keyboard_line_complete_t)(void *userdata,
const char *line);
typedef bool (*input_keyboard_press_t)(void *userdata, unsigned code);
struct input_keyboard_ctx_wait
{
void *userdata;
input_keyboard_press_t cb;
};
/**
* input_keyboard_event:
* @down : Keycode was pressed down?
* @code : Keycode.
* @character : Character inputted.
* @mod : TODO/FIXME: ???
*
* Keyboard event utils. Called by drivers when keyboard events are fired.
* This interfaces with the global driver struct and libretro callbacks.
**/
void input_keyboard_event(bool down, unsigned code, uint32_t character,
uint16_t mod, unsigned device);
bool input_keyboard_line_append(const char *word);
/**
* input_keyboard_start_line:
* @userdata : Userdata.
* @cb : Line complete callback function.
*
* Sets function pointer for keyboard line handle.
*
* The underlying buffer can be reallocated at any time
* (or be NULL), but the pointer to it remains constant
* throughout the objects lifetime.
*
* Returns: underlying buffer of the keyboard line.
**/
const char **input_keyboard_start_line(void *userdata,
input_keyboard_line_complete_t cb);
bool input_keyboard_ctl(enum rarch_input_keyboard_ctl_state state, void *data);
extern struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END];
extern struct retro_keybind input_autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END];
extern const struct retro_keybind *libretro_input_binds[MAX_USERS];
extern char input_device_names[MAX_USERS][64];
const char *input_config_bind_map_get_base(unsigned i);
unsigned input_config_bind_map_get_meta(unsigned i);
const char *input_config_bind_map_get_desc(unsigned i);
bool input_config_bind_map_get_valid(unsigned i);
/* auto_bind can be NULL. */
void input_config_get_bind_string(char *buf,
const struct retro_keybind *bind,
const struct retro_keybind *auto_bind, size_t size);
/**
* input_config_translate_str_to_rk:
* @str : String to translate to key ID.
*
* Translates tring representation to key identifier.
*
* Returns: key identifier.
**/
enum retro_key input_config_translate_str_to_rk(const char *str);
const char *input_config_get_prefix(unsigned user, bool meta);
/**
* input_config_translate_str_to_bind_id:
* @str : String to translate to bind ID.
*
* Translate string representation to bind ID.
*
* Returns: Bind ID value on success, otherwise
* RARCH_BIND_LIST_END on not found.
**/
unsigned input_config_translate_str_to_bind_id(const char *str);
void input_config_parse_key(void *data,
const char *prefix, const char *btn,
struct retro_keybind *bind);
void input_config_parse_joy_button(void *data, const char *prefix,
const char *btn, struct retro_keybind *bind);
void input_config_parse_joy_axis(void *data, const char *prefix,
const char *axis, struct retro_keybind *bind);
void input_config_parse_mouse_button(void *data, const char *prefix,
const char *btn, struct retro_keybind *bind);
void input_config_set_device_name(unsigned port, const char *name);
void input_config_set_device_display_name(unsigned port, const char *name);
void input_config_set_device_config_name(unsigned port, const char *name);
void input_config_clear_device_name(unsigned port);
void input_config_clear_device_display_name(unsigned port);
void input_config_clear_device_config_name(unsigned port);
unsigned input_config_get_device_count(void);
unsigned *input_config_get_device_ptr(unsigned port);
unsigned input_config_get_device(unsigned port);
void input_config_set_device(unsigned port, unsigned id);
const char *input_config_get_device_name(unsigned port);
const char *input_config_get_device_display_name(unsigned port);
const char *input_config_get_device_config_name(unsigned port);
const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id);
void input_config_set_pid(unsigned port, uint16_t pid);
uint16_t input_config_get_pid(unsigned port);
void input_config_set_vid(unsigned port, uint16_t vid);
uint16_t input_config_get_vid(unsigned port);
void input_config_reset(void);
void set_connection_listener(pad_connection_listener_t *listener);
void fire_connection_listener(unsigned port, input_device_driver_t *driver);
extern input_device_driver_t dinput_joypad;
extern input_device_driver_t linuxraw_joypad;
extern input_device_driver_t parport_joypad;
extern input_device_driver_t udev_joypad;
extern input_device_driver_t xinput_joypad;
extern input_device_driver_t sdl_joypad;
extern input_device_driver_t ps4_joypad;
extern input_device_driver_t ps3_joypad;
extern input_device_driver_t psp_joypad;
extern input_device_driver_t ps2_joypad;
extern input_device_driver_t ctr_joypad;
extern input_device_driver_t switch_joypad;
extern input_device_driver_t xdk_joypad;
extern input_device_driver_t gx_joypad;
extern input_device_driver_t wiiu_joypad;
extern input_device_driver_t hid_joypad;
extern input_device_driver_t android_joypad;
extern input_device_driver_t qnx_joypad;
extern input_device_driver_t null_joypad;
extern input_device_driver_t mfi_joypad;
extern input_device_driver_t dos_joypad;
extern input_device_driver_t rwebpad_joypad;
extern input_driver_t input_android;
extern input_driver_t input_sdl;
extern input_driver_t input_dinput;
extern input_driver_t input_x;
extern input_driver_t input_ps4;
extern input_driver_t input_ps3;
extern input_driver_t input_psp;
extern input_driver_t input_ps2;
extern input_driver_t input_ctr;
extern input_driver_t input_switch;
extern input_driver_t input_xenon360;
extern input_driver_t input_gx;
extern input_driver_t input_wiiu;
extern input_driver_t input_xinput;
extern input_driver_t input_uwp;
extern input_driver_t input_linuxraw;
extern input_driver_t input_udev;
extern input_driver_t input_cocoa;
extern input_driver_t input_qnx;
extern input_driver_t input_rwebinput;
extern input_driver_t input_dos;
extern input_driver_t input_winraw;
extern input_driver_t input_wayland;
extern input_driver_t input_null;
#ifdef HAVE_HID
extern hid_driver_t iohidmanager_hid;
extern hid_driver_t btstack_hid;
extern hid_driver_t libusb_hid;
extern hid_driver_t wiiusb_hid;
extern hid_driver_t null_hid;
#endif
RETRO_END_DECLS
#endif