Hi Antonio
If a pin is configured as GPIO (with clock gated to it) and its GPIOx_PDDR is '0' you can read its state in the GPIOx_PDIR register.
I don't have the impression that developers using the NXP forum use Arduino so you may find more suitable answers to your environment at the Teensy forum - the TEENSY 3.5 uses the K64.
In case you are making a transition from the Arduino world you can try the uTasker project (open source on Git Hub) since it also supports TEENSy 3.5 (and FRDM-K64F etc.), including simulation of the device/board so that you can more easily learn the internal workings. It doesn't constrain you to a certain environment since it is neutral and includes project for most common IDEs (MCUXpresso, CW, KDS, IAR, Keil, Rowley, Atollic, etc...).
Regards
Mark