Results 1 to 14 of 14

Thread: How to establish a connection between a key and the console??

  1. #1
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Question How to establish a connection between a key and the console??

    Hello every one

    I want to design a console application in which it must have connection with keys on the keyboard.That means, i have 4 keys on my device(f1,f2,f3,f4) and when i press a key,i must access the icons on the display.....can any one please help me in writing the code for this app??

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How to establish a connection between a key and the console??

    console application as in terminal or as in runing without GUI?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: How to establish a connection between a key and the console??

    @ anda_skoa

    sorry i dint get u...

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How to establish a connection between a key and the console??

    The term console application can mean two different things:

    - a program that runs a shell or console interface, also referred to as a terminal program
    - a program running in a shell

    Since you wrote "icons" I assume the former but since in that context this would easily be solvable through QAction I wanted to get a clarifcation first.

    Cheers,
    _

  5. #5
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: How to establish a connection between a key and the console??

    a program running in a shell...

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: How to establish a connection between a key and the console??

    Quote Originally Posted by Harini View Post
    a program running in a shell...
    And where are the "icons" then?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: How to establish a connection between a key and the console??

    Been searching the forums and online tutorials to find any info on this, but no luck yet.
    Here in our application in which we want to design,when we press the button on the keyboard the application must be opened....there is no use of icon...how to do this??I'm not getting any idea about the code....
    Quote Originally Posted by wysota View Post
    And where are the "icons" then?
    Last edited by Harini; 17th December 2013 at 07:29.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: How to establish a connection between a key and the console??

    If you want us to help you, you have to explain what is the problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How to establish a connection between a key and the console??

    Quote Originally Posted by Harini View Post
    Here in our application in which we want to design,when we press the button on the keyboard the application must be opened
    You seem to keep changing the requirements arbitrarily.
    Now you want to start your application when a certain button is pressed?

    Quote Originally Posted by Harini View Post
    ....there is no use of icon
    Another change in requirements, you originally claimed:
    Quote Originally Posted by Harini View Post
    i must access the icons on the display.
    Quote Originally Posted by Harini View Post
    ...how to do this??
    How to do what?

    As wysota said: if you don't tell us what you need to do there is no way to help you.

    Cheers,
    _

  10. #10
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: How to establish a connection between a key and the console??

    Seems like Harini is trying to use some sort of keyboard hook.

    I guess this wont be possible with Qt as you don't want to show UI. You will need some system level hooking of keys

  11. The following user says thank you to aamer4yu for this useful post:

    Harini (17th December 2013)

  12. #11
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: How to establish a connection between a key and the console??

    Quote Originally Posted by anda_skoa View Post
    You seem to keep changing the requirements arbitrarily.
    Now you want to start your application when a certain button is pressed?


    Another change in requirements, you originally claimed:



    How to do what?

    As wysota said: if you don't tell us what you need to do there is no way to help you.

    Cheers,
    _
    actually,i dint change
    i asked for ur help as what my superior asked me to do....
    here goes my need, when i press the button on the keyboard the camera app has to get opened....(just as the work of navigation key in nokia phones :P )

    okay! then tell me the way how it could be possible... :P
    Quote Originally Posted by aamer4yu View Post
    Seems like Harini is trying to use some sort of keyboard hook.

    I guess this wont be possible with Qt as you don't want to show UI. You will need some system level hooking of keys

    Added after 12 minutes:


    sir my problem is to make an app which resembles like a navigation key or a menu key in our mobiles(i.e when ever we press the key on the keyboard, the application has to opened and we have to access the application using the keys i.e without using touchscreen... )for this have been searching for the sample code at least for getting an idea how to do.
    Quote Originally Posted by wysota View Post
    If you want us to help you, you have to explain what is the problem.
    Last edited by Harini; 17th December 2013 at 11:05.

  13. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: How to establish a connection between a key and the console??

    So you have two applications? One which is active and should react to a certain key to start the other application ("camera app")?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  14. #13
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: How to establish a connection between a key and the console??

    yes how can I make this???
    Quote Originally Posted by wysota View Post
    So you have two applications? One which is active and should react to a certain key to start the other application ("camera app")?

  15. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: How to establish a connection between a key and the console??

    Quote Originally Posted by Harini View Post
    yes how can I make this???
    If this application is running in the background you have to hook into system's hotkey infrastructure. If the application has a UI and is the currently active application, you can use QAction.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. The following user says thank you to wysota for this useful post:

    Harini (18th December 2013)

Similar Threads

  1. Telnet connection does not establish...
    By gentlesea in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2011, 10:54
  2. Replies: 8
    Last Post: 15th July 2010, 22:42
  3. Replies: 3
    Last Post: 11th May 2010, 08:10
  4. Replies: 3
    Last Post: 29th November 2009, 08:24
  5. QSQLITE | unable to establish connection
    By suresh in forum Newbie
    Replies: 4
    Last Post: 1st July 2008, 12:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.