This is the code I'm referring to :

        char c = (char)waitKey();

        if( c == 27 )
            break;

        if( c == 'r' )
        {.....

The function waitKey, above, outputs an integer as return and it's being cast to a char to make the result a letter. Can this be done in CFFI. I have a CFFI wrapper for waitKey btw, that has an :int return