I would like to setup keyboard shortcuts for GPS data capture with QGIS.

Using GPS Information dialog box, I could use Mouse-Left-Click to "Add feature" and "Add track point", but I would like to assign keyboard shortcuts for them so that I can use a programmable Mouse.

Settings --> Configure Shortcuts lists only few commands

Is there a way I can call the API behind that and assign to a shortcut key?

  • 2
    Which OS are you using? There are both built-in and third-party applications that can help with this, but depends on which system you're using.
    – Simbamangu
    Sep 11, 2012 at 6:08
  • @Simbamangu Windows 7 and I intend to use CM Storm Sentinel Advance II mouse which comes with its own program to assign shortcuts link
    – Thiru
    Sep 13, 2012 at 4:45

1 Answer 1


The following code will allow you to access the GPS action:

GPSdock = iface.mainWindow().findChild(QDockWidget, "GPSInformation")
button = GPSdock.findChild(QPushButton, "mBtnCloseFeature")

You can wrap this logic in a plugin by using the QGIS Plugin Builder plugin from inside QGIS to get you a template for the plugin. Example coming later..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.