OnPressed event fired multiple times for single key-press

0

hi.

I use InputEventNotificationBus to get input, but the OnPressed event is fired multiple times for single key press!

질문됨 5년 전221회 조회
8개 답변
0
수락된 답변

Hi there! you could try to use InputChannelEventListener

example code here

답변함 5년 전
0

I noticed that the OnPressed() function is called once for each input component.

So if you have 4 input components, that function will be called 4 times.

답변함 5년 전
0

That's what I was looking for.

Thanks.

답변함 5년 전
0

Another feature to be aware of is: consuming or not consuming events. Those callbacks have a bool return value that allows you to indicate if you wish to consume the event.

답변함 5년 전
0

Hi @REDACTEDUSER

If I understand it, it's used for ui purposes?

답변함 5년 전
0

Thank you for the clarification.

답변함 5년 전
0

Yes but it's a more general idea that some listener have a higher priority than others and can consume those events.

답변함 5년 전
0

See a comment here:

dev\Code\Framework\AzFramework\AzFramework\Input\Events\InputChannelEventListener.h

        //! Override to be notified when an input channel is active or its state or value is updated,
//! unless the event was consumed by a higher priority listener, or did not pass the filter.
//! \param[in] inputChannel The input channel that is active or whose state or value updated
//! \return True if the input event has been consumed, false otherwise
virtual bool OnInputChannelEventFiltered(const InputChannel& inputChannel) = 0;

답변함 5년 전

이 게시물은 마감됨: 새 답변, 댓글 및 투표 추가가 비활성화되었습니다.

관련 콘텐츠