Someone having a better idea to keep trailing spaces in an on input event?
(It's for "live" filtering the content of a custom window. In fact I'm using the "on keyup" event to trigger a delayed "editbox -n"; the filtering itself is triggered out of "on input". The code below is a demo only to show how I keep trailing spaces atm...)
Thanks! smile
Code:
alias test { window -ae @test }
on *:KEYUP:@test:*: {
  if (($editbox($target).selstart == $editbox($target).selend) && (($keyval > 40) || ($istok(8 32,$keyval,32))))  {
    set -e %trailingspace $iif(($keyval == 32),1,0)
  }
}

on *:INPUT:@test: {
  echo $target input of "on input": $+([,$1-,])
  editbox $iif((%trailingspace),-p) $target $1-
  echo $target input "out of editbox": $+([,$editbox($target),])
}