View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002611 | FSSCP | SEXPs | public | 2012-02-23 05:13 | 2012-02-29 06:07 |
| Reporter | karajorma | Assigned To | karajorma | ||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.7.2 | ||||
| Target Version | 3.7.2 | ||||
| Summary | 0002611: Ignore-Key SEXP doesn't work for joysticks or mouse | ||||
| Description | You currently can get around the restictions of the ignore-key SEXP by simply assigning the ignored key to a joystick or mouse button. This patch should fix that. | ||||
| Tags | No tags attached. | ||||
|
|
Improved-Ignore-Key.patch (881 bytes)
Index: controlsconfig.cpp
===================================================================
--- controlsconfig.cpp (revision 8529)
+++ controlsconfig.cpp (working copy)
@@ -2100,7 +2100,7 @@
Control_check_count = 0;
}
-int check_control(int id, int key)
+int check_control_used(int id, int key)
{
int z, mask;
static int last_key = 0;
@@ -2171,6 +2171,24 @@
return 0;
}
+/**
+* Wrapper for check_control_used. Allows the game to ignore the key if told to do so by the ignore-key SEXP.
+*/
+int check_control(int id, int key)
+{
+ if (check_control_used(id, key)) {
+ if (Ignored_keys[id]) {
+ if (Ignored_keys[id] > 0) {
+ Ignored_keys[id]--;
+ }
+ return 0;
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
// get heading, pitch, bank, throttle abs. and throttle rel. values.
void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
{
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-02-23 05:13 | karajorma | New Issue | |
| 2012-02-23 05:13 | karajorma | Status | new => assigned |
| 2012-02-23 05:13 | karajorma | Assigned To | => karajorma |
| 2012-02-23 05:13 | karajorma | File Added: Improved-Ignore-Key.patch | |
| 2012-02-23 05:14 | karajorma | Status | assigned => code review |
| 2012-02-29 06:07 | karajorma | Status | code review => resolved |
| 2012-02-29 06:07 | karajorma | Resolution | open => fixed |