Package com.mouseviator.fsuipc.helpers
Class MacroHelper.MacroExecuteRequest
java.lang.Object
com.mouseviator.fsuipc.datarequest.DataRequest
com.mouseviator.fsuipc.helpers.MacroHelper.MacroExecuteRequest
- All Implemented Interfaces:
IDataRequest<java.lang.String>
,IWriteOnlyRequest<java.lang.String>
- Enclosing class:
- MacroHelper
public static class MacroHelper.MacroExecuteRequest extends DataRequest implements IWriteOnlyRequest<java.lang.String>
This class implements macro execute request. It is a WRITE type request, writing a string at offset 0x0D70. This
string than identifies what macro from what macro file should FSUIPC execute.
Note that the string format is: "<macro file name>:<macro_name>". The maximum length of the <macro file name> is
16 characters. The maximum length of the <macro_name> is 16 characters. The separator char must be ":".
The constructors as well as the
setValue(java.lang.String)
will check for these limitations and will
raise the InvalidParameterException
if not met.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mouseviator.fsuipc.datarequest.IDataRequest
IDataRequest.RequestType
-
Field Summary
Fields Modifier and Type Field Description static char
MACRO_SEPARATOR
This character is used to separate macro file name and macro name when calling macro using FSUIPCFields inherited from class com.mouseviator.fsuipc.datarequest.DataRequest
BUFFER_LENGTH_BYTE, BUFFER_LENGTH_DOUBLE, BUFFER_LENGTH_FLOAT, BUFFER_LENGTH_INT, BUFFER_LENGTH_LONG, BUFFER_LENGTH_SHORT, dataBuffer, MAX_OFFSET_VALUE, MIN_OFFSET_VALUE, offset, type
-
Constructor Summary
Constructors Constructor Description MacroExecuteRequest(java.lang.String macro)
Constructs new macro execute request to execute given macro.MacroExecuteRequest(java.lang.String macroFile, java.lang.String macroName)
Constructs new macro execute request to execute given macro from given macro file.MacroExecuteRequest(java.lang.String macroFile, java.lang.String macroName, java.nio.charset.Charset charset)
Constructs new macro execute request to execute given macro from given macro file.MacroExecuteRequest(java.lang.String macro, java.nio.charset.Charset charset)
Constructs new macro execute request to execute given macro. -
Method Summary
Modifier and Type Method Description java.nio.charset.Charset
getCharset()
Returns the charset that is used to convert string containing macro file and macro name to the byte array for FSUIPC.void
setCharset(java.nio.charset.Charset charset)
Sets the charset to use when converting string value that should contain macro file name and macro name to the byte array for FSUIPC.void
setValue(java.lang.String value)
(The name of the macro file, the ":" char and the name of macro within that file).Methods inherited from class com.mouseviator.fsuipc.datarequest.DataRequest
convertStringToByteArray, copyByteArray, getDataBuffer, getDouble, getFloat, getInt, getLong, getOffset, getShort, getSize, getType, getZeroTerminatedString, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, setOffset, setType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.mouseviator.fsuipc.datarequest.IDataRequest
getDataBuffer, getOffset, getSize, getType, setOffset, setType
Methods inherited from interface com.mouseviator.fsuipc.datarequest.IWriteOnlyRequest
getValue
-
Field Details
-
MACRO_SEPARATOR
public static final char MACRO_SEPARATORThis character is used to separate macro file name and macro name when calling macro using FSUIPC- See Also:
- Constant Field Values
-
-
Constructor Details
-
MacroExecuteRequest
public MacroExecuteRequest(java.lang.String macro) throws java.security.InvalidParameterExceptionConstructs new macro execute request to execute given macro.- Parameters:
macro
- A macro to execute.- Throws:
java.security.InvalidParameterException
-
MacroExecuteRequest
public MacroExecuteRequest(java.lang.String macro, java.nio.charset.Charset charset) throws java.security.InvalidParameterExceptionConstructs new macro execute request to execute given macro.- Parameters:
macro
- A macro to execute.charset
- Charset to use during conversion ofmacro
to the byte array for FSUIPC.- Throws:
java.security.InvalidParameterException
-
MacroExecuteRequest
public MacroExecuteRequest(java.lang.String macroFile, java.lang.String macroName) throws java.security.InvalidParameterExceptionConstructs new macro execute request to execute given macro from given macro file.- Parameters:
macroFile
- Macro file name.macroName
- Name of the macro inside the macro file.- Throws:
java.security.InvalidParameterException
-
MacroExecuteRequest
public MacroExecuteRequest(java.lang.String macroFile, java.lang.String macroName, java.nio.charset.Charset charset) throws java.security.InvalidParameterExceptionConstructs new macro execute request to execute given macro from given macro file.- Parameters:
macroFile
- Macro file name.macroName
- Name of the macro inside the macro file.charset
- Charset to use during conversion ofmacroFile
andmacroName
to the byte array for FSUIPC.- Throws:
java.security.InvalidParameterException
-
-
Method Details
-
setValue
public void setValue(java.lang.String value)(The name of the macro file, the ":" char and the name of macro within that file).- Specified by:
setValue
in interfaceIDataRequest<java.lang.String>
- Parameters:
value
- A macro to execute.
-
getCharset
public java.nio.charset.Charset getCharset()Returns the charset that is used to convert string containing macro file and macro name to the byte array for FSUIPC.- Returns:
- The charset used.
-
setCharset
public void setCharset(java.nio.charset.Charset charset)Sets the charset to use when converting string value that should contain macro file name and macro name to the byte array for FSUIPC. Call this beforesetValue(java.lang.String)
, otherwise the change will have no effect.- Parameters:
charset
- The charset to use.
-