SimpleCalculator
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    Hotkey? Simply get the digits.
    If you have a PowerBook without numeric keyboard, you have to use the main keyboard.
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »16.11.24 - 23:06
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 534 from 2003/2/25
    From: France
    Quote:

    Papiosaur wrote:
    get the digit?

    sorry, i'm a newbie in C and MUI...




    You want to grab numeric keystrokes?

    There is many ways to achieve that.

    Probably, the easier is doing a custom mui group class at the root of your mui object tree and setup some MUI event handler for grabbing ICMP_RAWKEY events.

    Then, from that subclass, you can check if numeric keys has been hit and do whatever processing you like with inside the MUIM_HandleEvent method.

    If you're doing something with the keyboard event and you don't want other objects in the object MUI tree to react to that event, you can instruct MUI to 'eat' the event (ie: kind of discard) by returning MUI_EventHandlerRC_Eat in the MUIM_HandleEvent method.

    For succeeding with all that, you first need to master MUI subclassing concepts. Best is probably reading some obligement article on the matter, for example:

    http://obligement.free.fr/articles/mui_custom_class.php

    Keywords: MUI subclass, MUIM_Window_AddEventHandler, MUI_EventHandlerRC_Eat
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »17.11.24 - 09:28
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2323 from 2003/2/24
    The question is why IDCMP_RAWKEY and/or specific NumPad keys?

    Why should it matter which 123....-+/= etc I hit?

    Just listen to IDCMP_VANILLAKEY and be done with it.
  • »17.11.24 - 10:14
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    If you only need some few shortcuts you can use
    MUIA_Window_InputEvent
  • »17.11.24 - 14:14
    Profile Visit Website