Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt keypressevent detects key press as hexa not ascii



  • Hi everyone,
    here i wrote a small application on serialport using Qserialport class where i done all the appliocation but struct with one final step. our customer wants to send a hexadecimal data not asciicharachters but keypress event will detect keyboard keys as only ascii charachters.
    So i want to know is there any procedure so that on GUI if i choose hex data then after if i press keys from keyboard ot should sense keys as hexa data also non hexa charachter(say like g to z) should be given a as non hexa charachter you entered.
    Is there any way to achive this.
    Thnaks & Regards
    A.N.V.Lavanya


  • Lifetime Qt Champion

    @Lavanya said in Qt keypressevent detects key press as hexa not ascii:

    So i want to know is there any procedure so that on GUI if i choose hex data then after if i press keys from keyboard ot should sense keys as hexa data also non hexa charachter(say like g to z) should be given a as non hexa charachter you entered.

    You should rephrase this as it is hard to understand what you mean.
    If you want to send numbers as hex strings (a key is nothing else as a number) then use https://doc.qt.io/qt-5/qstring.html#number



  • sorry for making it difficult post.
    My doubt is very simple i want to design the application same as Pcomm terminal where we have sending hexadecimal data facility.
    Thanks & Regards
    A.N.V.Lavanya



  • Still Waiting for a reply.



  • @Lavanya
    Nobody here knows what "same as Pcomm terminal" might be, nor how it behaves, nor what you want behaviour-wise from it.

    @jsulm stated what to call to convert a number to a hexadecimal string.



  • This post is deleted!

Log in to reply