Custom: Accepting GPIO button presses and releases as button events using BrightAuthor.

Important: These changes apply to BrightAuthor version 3.5 or earlier, and are not required in later versions of BrightAuthor, which include button up or down options for GPIO events.


If you want to be able to trigger events using both button presses and releases, there’s two simple changes you can make to the autorun script that BrightAuthor publishes to allow this if you are not using BrightAuthor 3.8 or newer.  

Note: The following change does not work inside of media lists or inside the interactive menu object.

Step 1:  Find the RunBSP function

1. Search for this function

  • Sub RunBsp(sysFlags As Object, sysInfo As Object, diagnosticCodes As Object)

2. Find this line, which creates the gpio object:

  • BSP.gpioPort = CreateObject("roGpioControlPort")

3. Comment out this line and add the following line to create a roControlPort Object. The resulting two lines should look like this:

    • 'BSP.gpioPort = CreateObject("roGpioControlPort")
    • BSP.gpioPort = CreateObject("roControlPort", "Brightsign") 

Step 2: Find the MediaItemEventHandler function

1. Search for this function:

  • Function MediaItemEventHandler(event As Object, stateData As Object) As Object

2. Find this line, which checks for a button event:

  • if type(event) = "roGpioButton" then

3. Comment out this line and replace it with a line that checks for button up and button down events. A button down event is like the normal button press. A button up event is the release of that button.

  • 'if type(event) = "roGpioButton" then
  • if type(event) = "roControlUp" or type(event) = "roControlDown" then

Step 3: Publish your project with your custom autorun

Have more questions? Submit a request


  • 0
    Alfonso Descalzo

    I´m using an XD1230 with BA BA and last beta firmware, and can´t find these lines:


    • BSP.gpioPort = CreateObject("roGpioControlPort")
    •  'if type(event) = "roGpioButton" then



  • 0
    Alfonso Descalzo with the BA, and the same,,, can´t find those lines or something similar,,


  • 0
    BrightSign Support

    These changes apply to BrightAuthor 3.7

    If you want to be able to listen for a button press and release in BrightAuthor, change the autorun script published by BrightAuthor to the following:

    Step 1: Find this function definition

    Sub GPIOEventHandler(event As Object)

    Step 2: Change the original line to the new line below

    Original:_ if m.state$ = "ButtonUp" then_

    New:_ if m.state$ = "ButtonUp" or m.state$ = "ButtonDown" then_

    Step 3: Change theoriginal line to the new lines below

    Original: m.state$ = "ButtonDown"


    if m.state$ = "ButtonUp" then _

    _     m.state$ = "ButtonDown" _

    _else _

    _     m.state$ = "ButtonUp" _


  • 0
    BrightSign Support

    The upcoming 3.8 Brightauthor version will have the ability to specify triggering the gpio event on button up or down. See attached image.

Please sign in to leave a comment.
Can't find what you're looking for? Try to
Powered by Zendesk