Hi Michael - could you give a working example? I am having trouble getting the event$ignore()/qupdate() combo to allow default qscatter activity in the example I provided yesterday [[reproduced below]]. Thanks much
#Why doesn't this work? I want "T" to move the red line up (new
#behavior) *and* display shift-T in upper right corner (default
#behavior)
qiris <- qdata(iris)
hline <- 2.0
mykeypress <- function(layer, event){
print('do something I want!')
if(match_key('T')){
hline <<- hline + .2
qupdate(new)
}
event$ignore()
}
p <- qscatter(data = qiris, x = Sepal.Length, y = Sepal.Width)
mydrawingFun <- function(layer, painter){
qdrawLine(painter, x = p$meta$limits[,1], y = hline, stroke = 'red')
}
new <- qlayer(paintFun = mydrawingFun, keyPressFun = mykeypress,
limits = qrect(p$meta$limits))
p$layerList[[1]][1,2] <- new
sync_limits(p$meta, new)
print(p)