DataWedge-Flutter-Demo icon indicating copy to clipboard operation
DataWedge-Flutter-Demo copied to clipboard

Cannot disable Keystroke Output when creating the profile.

Open alexsauce opened this issue 1 year ago • 2 comments

Hi, I have a new MC9300 that comes with Datawedge 8.2.4 and for some reason is acting different than the previous 7.3 version. I'll try to explain: When my TextField has the focus and I hit the scan trigger, it gets the value on the onEvent function, but right after DataWedge inject the scanned code again, duplicating the code. Manually I disable the "Keystroke Output" and it seems to help. I'm trying to disable keystroke output at the moment of the profile creating but is not working. Here is my code. Can you help me?

private fun createDataWedgeProfile(profileName: String) { // Create and configure the DataWedge profile associated with this application // For readability's sake, I have not defined each of the keys in the DWInterface file dwInterface.sendCommandString(this, DWInterface.DATAWEDGE_SEND_CREATE_PROFILE, profileName) val profileConfig = Bundle() profileConfig.putString("PROFILE_NAME", profileName) profileConfig.putString("PROFILE_ENABLED", "true") // These are all strings profileConfig.putString("CONFIG_MODE", "UPDATE") val barcodeConfig = Bundle() barcodeConfig.putString("PLUGIN_NAME", "BARCODE") barcodeConfig.putString("RESET_CONFIG", "true") // This is the default but never hurts to specify val barcodeProps = Bundle() barcodeConfig.putBundle("PARAM_LIST", barcodeProps) profileConfig.putBundle("PLUGIN_CONFIG", barcodeConfig) val appConfig = Bundle() appConfig.putString("PACKAGE_NAME", packageName) // Associate the profile with this app appConfig.putStringArray("ACTIVITY_LIST", arrayOf("*")) profileConfig.putParcelableArray("APP_LIST", arrayOf(appConfig)) dwInterface.sendCommandBundle(this, DWInterface.DATAWEDGE_SEND_SET_CONFIG, profileConfig) // You can only configure one plugin at a time in some versions of DW, now do the intent output profileConfig.remove("PLUGIN_CONFIG") val intentConfig = Bundle() intentConfig.putString("PLUGIN_NAME", "INTENT") intentConfig.putString("RESET_CONFIG", "true") val intentProps = Bundle() intentProps.putString("intent_output_enabled", "true") intentProps.putString("intent_action", PROFILE_INTENT_ACTION) intentProps.putString("intent_delivery", PROFILE_INTENT_BROADCAST) // "2" intentConfig.putBundle("PARAM_LIST", intentProps) profileConfig.putBundle("PLUGIN_CONFIG", intentConfig)

    val keystrokeConfig = Bundle()
    keystrokeConfig.putString("PLUGIN_NAME", "KEYSTROKE")
    keystrokeConfig.putString("RESET_CONFIG", "true")
    val keystrokeProps = Bundle()
    keystrokeProps.putString("keystroke_output_enabled", "false")
    keystrokeConfig.putBundle("PARAM_LIST", keystrokeProps)
    profileConfig.putBundle("PLUGIN_CONFIG", keystrokeConfig)
    dwInterface.sendCommandBundle(this, DWInterface.DATAWEDGE_SEND_SET_CONFIG, profileConfig)
    

}

alexsauce avatar Jul 25 '22 17:07 alexsauce