Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Detecting Keyboard-Close Button
Started by yosu Apr 16 2019 05:59 PM

1 reply to this topic

Best Answer yosu , 19 April 2019 - 06:19 PM

I have found a way to detect this. It is using the plugin 'more-info'.  I would need to continuously monitor the keyboard height to know whether the keyboard has been closed or not.

		function checkKeyboardHeight()
		
			local keyboardWidth, keyboardHeight = moreInfo.getKeyboardSize()

			-- if keyboardHeight == 0 then keyboard is closed
					
		end
		Runtime:addEventListener( "enterFrame", checkKeyboardHeight )

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

yosu

[GLOBAL: userInfoPane.html]
yosu
  • Contributor

  • 523 posts
  • Corona SDK

Hi,

 

 

Is there a way to detect the Android 'keyboard close button' ?

 

I use the 'Runtime:addEventListener( "key", onKeyEvent )', and it isn't detected. That leaves my 'native.newTextField()' hanging as I move it manually ('CoronaWindowMovesWhenKeyboardAppears = false').

 

If I use 'CoronaWindowMovesWhenKeyboardAppears = true' in my build settings, it moves everything  when the keyboard is closed and there isn't the hanging problem.

 

 

 

Attached Files



[TOPIC: post.html]
#2

yosu

[GLOBAL: userInfoPane.html]
yosu
  • Contributor

  • 523 posts
  • Corona SDK

  Best Answer

I have found a way to detect this. It is using the plugin 'more-info'.  I would need to continuously monitor the keyboard height to know whether the keyboard has been closed or not.

		function checkKeyboardHeight()
		
			local keyboardWidth, keyboardHeight = moreInfo.getKeyboardSize()

			-- if keyboardHeight == 0 then keyboard is closed
					
		end
		Runtime:addEventListener( "enterFrame", checkKeyboardHeight )



[topic_controls]
[/topic_controls]