Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Remove WARNING from console
Started by Dimahh90 May 21 2019 10:20 AM

- - - - -
4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Dimahh90

[GLOBAL: userInfoPane.html]
Dimahh90
  • Enthusiast

  • 45 posts
  • Corona SDK

Hello,
I'm constantly having following warning in the Simulator and would like to remove it if possible.
WARNING: Runtime:addEventListener: real ios devices don't generate 'key' events

 

The code looks like this:

if Runtime:hasEventSource( "key" ) then
   Runtime:addEventListener( "key", onKeyEvent )
end

Since I need to add and remove the eventListener again and again over time, I see this warning constantly.
Would be great if there's a way to prevent that.

Thanks



[TOPIC: post.html]
#2

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,136 posts
  • Corona SDK

In the simulator change the device to something that isn't an iOS device. I usually use the FireTV devices since I know those have key events. There might be others you can use. Check out the apple TV ones they might also work.


  • Dimahh90 likes this

[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,684 posts
  • Enterprise

Simply change to a non iOS skin and the warning will go away. 

 

Rob


  • Dimahh90 likes this

[TOPIC: post.html]
#4

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,085 posts
  • Corona SDK

I do this...

if not(system.getInfo("platform") == "ios") then
  Runtime:addEventListener("key", onKeyEvent)
end

  • Dimahh90 likes this

[TOPIC: post.html]
#5

Dimahh90

[GLOBAL: userInfoPane.html]
Dimahh90
  • Enthusiast

  • 45 posts
  • Corona SDK

So simple... thanks guys!




[topic_controls]
[/topic_controls]