|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.lirc.util.LIRCMap
Maps remote control buttons to Strings. The mapping can be saved to and read from a file with the following format: (a subset of the .lircrc file format, see the LIRC documentation):
# comment begin button = button_name [remote = remote_name] [repeat = positive integer] [config = string] [config = string] ... end
Empty lines and lines starting with "#" are ignored.
button
is the name of the button that this section concerns.
remote
is the name of the remote control that this section concerns.
If this line is omitted all remotes will be matched.
repeat
specifies how repeat events will be matched. A value of 0
means that no repeat events will be matched, i.e. only the first event is matched when
a button is held down. A value n > 0 means that every n:th event is reported, i.e.
every event for which repeat % n == 0
. If the repeat line is omitted
only the first event will be reported, i.e. repeat = 0
config
lines specify the strings that will be mapped to the event. If
several config strings are specified they will be cycled through. This lets
you implement toggle buttons etc.
begin button = power config = on config = off end begin button = vol+ repeat = 1 config = volup end begin button = four remote = RM-D90 repeat = 5 config = left end
Inner Class Summary | |
protected static class |
LIRCMap.Entry
The entries in this map. |
Constructor Summary | |
LIRCMap()
Creates a new empty LIRCMap. |
|
LIRCMap(java.lang.String program)
Creates a new empty LIRCMap. |
|
LIRCMap(java.lang.String program,
java.io.File file)
Reads a LIRCMap from a file. |
Method Summary | |
protected void |
add(LIRCMap.Entry e)
Adds an Entry. |
void |
add(java.lang.String button,
java.lang.String remote,
int repeat,
java.lang.String value)
Adds a value mapping to this map. |
void |
add(java.lang.String button,
java.lang.String remote,
int repeat,
java.lang.String[] values)
Adds a value mapping to this map. |
java.lang.String |
get(LIRCEvent e)
Gets the String that matches a LIRCEvent. |
void |
load(java.io.File file)
Loads settings from a file. |
void |
load(java.io.Reader reader)
Loads settings from a Reader . |
void |
load(java.lang.String filename)
Loads settings from a file. |
static void |
main(java.lang.String[] args)
For testing. |
void |
store(java.io.File file)
Writes this LIRCMap to a file. |
void |
store(java.lang.String filename)
Writes this LIRCMap to a file. |
void |
store(java.io.Writer writer)
Writes this LIRCMap to a Writer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LIRCMap()
public LIRCMap(java.lang.String program)
public LIRCMap(java.lang.String program, java.io.File file) throws java.io.IOException
LIRCMap map = new LIRCMap(program); map.load(file);
Method Detail |
public void load(java.lang.String filename) throws java.io.IOException
public void load(java.io.File file) throws java.io.IOException
public void load(java.io.Reader reader) throws java.io.IOException
Reader
.public void store(java.lang.String filename) throws java.io.IOException
public void store(java.io.File file) throws java.io.IOException
public void store(java.io.Writer writer) throws java.io.IOException
public java.lang.String get(LIRCEvent e)
e
- The eventpublic void add(java.lang.String button, java.lang.String remote, int repeat, java.lang.String value)
button
- The button to matchremote
- The remote valuerepeat
- The repeat valuevalue
- The value to map to the parameterspublic void add(java.lang.String button, java.lang.String remote, int repeat, java.lang.String[] values)
button
- The button to matchremote
- The remote valuerepeat
- The repeat valuevalues
- The values to map to the parametersprotected void add(LIRCMap.Entry e)
e
- The Entry to addpublic static void main(java.lang.String[] args) throws java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |