Getting multi-stage text input status in SwiftUI

Hi all,

Is there way to check the status of multi-stage text input in the TextField of SwiftUI?

I am essentially trying to detect if the user is entering some text with multi-stage text input method right now. (e.g., Japanese, Chinese, etc).

TextField("Search", text: $searchText)
    .onKeyPress(keys: [.upArrow, .downArrow]) { event in
        
        if ....some condition here... {
            // ignore up/down keys when multi-stage input
            return .ignored 
        }
        else {
            // do some special key handling
            // when multi-stage input is not running
            return .handled
        }
    }

Multi-stage text input uses up/down keys to choose words from candidates, so I don't want to handle the keys when it is happening.

Getting multi-stage text input status in SwiftUI
 
 
Q