SKUI Textbox :onkey event getkey
-
Hi
I am trying to figure out is there a way, without changing SKUI wraper from thomthom, to get "ENTER" press event.
I am using SKUI in my plugin, and because i am not very experienced in ruby, its very helpful. But i cant get this work.
Any help will be welcome.
Best regardsmy code:
def testwindow window = SKUI;;Window.new( title; 'Test Window', width; 500, height; 210, resizable; false) txt = SKUI;;Textbox.new( 'nothing' ) txt.position( 10, 10 ) txt.width = 70 txt.on( ;change) { |c| @promien = c.value } txt.on( ;keyup) { |c| puts "keyup; #{c.value} '#{STDIN.getc}'" } txt.on( ;keydown) { |c| puts "keydown; #{c.value}" } txt.on( ;keypress) { |c| puts "keypress; #{c.value}" } window.add_control( txt ) end
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement