diff options
author | endolf <[email protected]> | 2005-12-04 16:39:13 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2005-12-04 16:39:13 +0000 |
commit | 183f7d09dd080c1663dadf388e6eb6ba31703253 (patch) | |
tree | 7bf125b6df9a766b9a2df8538a3ea3cbfc7b1271 /plugins | |
parent | 172a3a5309b4155548bf1e0559b45597d8ad07b1 (diff) |
First bodge at pursuading windows to use some of the same button ID's as linux. I dunno which is right, I suspect that both are as there is no standard that both admit to. So for now, lets do that good old nasty hack of string searching.
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@132 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/DX8/src/java/net/java/games/input/DirectInputAxis.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/DX8/src/java/net/java/games/input/DirectInputAxis.java b/plugins/DX8/src/java/net/java/games/input/DirectInputAxis.java index cdc9267..1312769 100644 --- a/plugins/DX8/src/java/net/java/games/input/DirectInputAxis.java +++ b/plugins/DX8/src/java/net/java/games/input/DirectInputAxis.java @@ -135,6 +135,21 @@ class DirectInputAxis extends AbstractComponent { offset = 12 + (instance/4); bitshift = (instance%4)*8; bitmask=0xff; + + //Nasty cludge to get some similarities across platforms. + if(name.contains("A Button")) { + this.id = Component.Identifier.Button.A; + } else if(name.contains("B Button")) { + this.id = Component.Identifier.Button.B; + } else if(name.contains("C Button")) { + this.id = Component.Identifier.Button.C; + } else if(name.contains("X Button")) { + this.id = Component.Identifier.Button.X; + } else if(name.contains("Y Button")) { + this.id = Component.Identifier.Button.Y; + } else if(name.contains("Z Button")) { + this.id = Component.Identifier.Button.Z; + } } } |