Peripheral Keyboard and Barcode Scanner

The project demonstrates how to turn a Flutter mobile app into a peripheral keyboard and barcode scanner to input data into PCs.

Setting Up the Python Server

  1. Install pyautogui, websockets and zeroconf using pip:

    pip install pyautogui websockets zeroconf
  2. Change the port numbers for Bonjour service and web socket server if they are already in use.

    # Bonjour
    info = ServiceInfo("_bonsoirdemo._tcp.local.",
                    "Python Web Socket Server._bonsoirdemo._tcp.local.",
                    port=7000, addresses=[ip_address])
    # Web Socket Server
    s = await websockets.serve(server, ip_address, 4000)

    If you change the web socket port in the server, you also need to change the port in the Flutter app.

  3. Run the server:


Setting Up the Flutter Mobile App

  1. Apply for a trial license key of Dynamsoft Barcode Reader SDK from here.

  2. Replace the license key in the scanner_screen.dart file.

    await DCVBarcodeReader.initLicense(
  3. Run the app on your mobile device.

    flutter run


View Github