Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

I appreciate your time. Thanks, Thiru

share|improve this question
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 '12 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 '12 at 4:45
add comment

1 Answer

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

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

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..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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