PyCharm is trying to say that the event property of the window is deprecated. Which… technically it is, but it’s been Legacy’d into standarization for the window object. This may cause problems when the object is not in the window (Shadow elements or non-browser contexts), so its not recommended for use.
What you’re referring to with event is actually window.event; if you need to catch the event object, it’s better to invoke a function, to which an Event object will be passed. Inline javascript is generally not recommended either, but thats beyond the scope of the question.