persistent_add MOUSE DEV &&
# query not config_query! See locale's CONFIGURE for explanation why this is correct
if query "Do you want to select a mouse type and device?" n; then
    MOUSETYPES=$(< $SCRIPT_DIRECTORY/mousetypes)
    MOUSETYPES=$(dialog \
      --backtitle 'GPM Configuration Menu' \
      --stdout \
      --title     'Select your mouse type please' \
      --menu      '' 0 100 10 $MOUSETYPES)
    MOUSE="${MOUSETYPES//\"/}"

    MOUSEDEV=$(< $SCRIPT_DIRECTORY/mousedev)
    MOUSEDEV=$(dialog \
      --backtitle 'GPM Configuration Menu' \
      --stdout \
      --title     'Select your mouse device entry please' \
      --menu      '' 0 100 10 $MOUSEDEV)
    if [[ "$MOUSEDEV" == "custom" ]]; then
      persistent_remove DEV
      config_query_string DEV "Input mouse device:"
    else      
      DEV="${MOUSEDEV//\"/}"
    fi
fi
