Commit Graph

4 Commits

Author SHA1 Message Date
Jasper St. Pierre d5983b587e InputConfigDialog: Don't show "..." for complicated expressions
Just show the actual expression. We need to do a bit of mangling
here as wx has no way to turn off mnemonics parsing, so do that
as well.
2013-06-29 18:28:14 -04:00
Jasper St. Pierre f53eefb491 ExpressionParser: Add support for simple barewords control names
If an expression can't be parsed normally, we then look to see if it's a
simple device name. This keeps backwards compatibility with simple input
ocnfigurations, where people just used the Detect button.
2013-06-26 20:19:23 -04:00
Jasper St. Pierre c5c86d17dc InputConfigDiag: Use "..." for complicated expressions
The full expression is quite often too big for a simple button
label, so encourage people to use the full editor to edit it.
2013-06-25 00:58:31 -04:00
Jasper St. Pierre 6246f6e815 InputCommon: Add a new ExpressionParser to replace the old hack language
This contains a new, hand-written expression parser to replace the old
hack language based on string munging. The new approach is a simple
AST-based evaluation approach, instead of the "list of operations"
infix-based hack that there was before.

The new language for configuration has support for parentheses, and
counts "!" as a unary operator instead of the binary "NOT OR" operator
it was before. A simple example:

  (X & Y) | !B

Explicit device references, and complex device names ("Right Y+") are
handled with backticks and colons:

  (`SDL/0/6 axis joystick:Right X+` & `DInput/0/Keyboard Mouse:A`)

The basic editor UI that inserts tokens has not been updated to reflect
the new language.
2013-06-25 00:58:30 -04:00