use MPV::Simple; my $ctx = MPV::Simple->new(); $ctx->set_property_string('input-default-bindings','yes'); $ctx->set_property_string('input-vo-keyboard','yes'); $ctx->set_property_string('osc','no'); my $userdata = "test"; my $data = $ctx->set_wakeup_callback(\&func,$userdata); $ctx->initialize(); $ctx->command(); exit 0; sub func {print "callback called \n"}