The ViewModel is the model for the view, so when you refer to a state that must have a view or the data that it must represent, the ViewModel must process it.
One could reasonably use the Visibility enumeration to represent which part of the view should be considered information about the state of the view.
As for KeyEventArgs, this comes from the user's action and represents some state of the command, which, if you need to know which key was pressed, is a reasonable expectation of processing ViewModel.
arg, , unit test .
, Visibility KeyEventArgs - , , ViewModel . , (, , , , , ViewModels).