Skip to content
  • Rob Swindell's avatar
    Optionally distinguish between timeout and NUL inkey() result · bec4667e
    Rob Swindell authored
    Some terminals can send NUL (ASCII 0), e.g. hitting Ctrl-Space in Apple iTerm. Allow users of inkey() (in C++ or JS) to optionally detect the difference by specifying the K_NUL mode flag. In JS, console.inkey() will return null upon timeout (rather than "") when the K_NUL mode flag is used and return an empty string ("") upon receipt of NUL (ASCII 0).
    
    The default is the previous behavior where a timeout and the receipt of a NUL character appear the same to the caller of inkey().
    bec4667e