Is there a way to access the volume keys on an N8 using QT?

I am using the following code but am unable to get a response.


Qt Code:
  1. HEADER
  2. const int EKeyIncVolume = 63552;
  3. const int EKeyDecVolume = 63553;
  4.  
  5. public:
  6. void keyPressEvent(QKeyEvent *);
  7.  
  8.  
  9. MAIN
  10.  
  11. #include <QKeyEvent>
  12.  
  13. void MainWindow::keyPressEvent(QKeyEvent* event)
  14. {
  15. switch (event->nativeVirtualKey())
  16. {
  17. case EKeyIncVolume:
  18. {
  19. this->ui->label->setText("Up");
  20. break;
  21. }
  22. case EKeyDecVolume:
  23. {
  24. this->ui->label->setText("Down");
  25. break;
  26. }
  27. };
  28. }
To copy to clipboard, switch view to plain text mode