[fpc-pascal] Getting Shift key with PTCCRT
    wkitty42 at windstream.net 
    wkitty42 at windstream.net
       
    Sat Sep 10 11:51:01 CEST 2022
    
    
  
On 9/9/22 5:54 PM, James Richters via fpc-pascal wrote:
> I have some key sequences with PTCCRT.READKEY  where I use a lower case
> letter to do one thing and an uppercase to do another, but if the Capslock
> is on, they do the wrong things.  Is there a way I can check the condition
> of the shift key to see if shift was actually pressed instead of just going
> by whether I got a capital letter or not?   The key input is not something
> that is ever displayed on the screen, it's just making selections and doing
> them.
looking at the list of constants in ptcpas, i find PTCKEY_SHIFT... i also find, 
in Classes, the IPTCKeyEvent which has a GetShift function as well as a Shift 
property... seems like you should be able to the shift status with something like
type myKeyEvent : IPTCKeyEvent;
type myShiftStatus : boolean;
myShiftStatus := myKeyEvent.Shift;
https://ptcpas.sourceforge.io/api-reference/ptc/iptckeyevent.html
NOTE: it has been way too long since i've actually written any pascal code... 
take the above with a grain of salt... i may have the syntax all wrong...
-- 
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list where it belongs!*
    
    
More information about the fpc-pascal
mailing list