loleaflet/src/layer/tile/TileLayer.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
New commits: commit 8d094fbf3fa051d740be21b2d9772efb0c0a59a3 Author: Henry Castro <hcas...@collabora.com> Date: Tue May 26 20:37:11 2015 -0400 Added keypress function to send keys diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index acbe575..e082883 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -74,6 +74,25 @@ L.TileLayer = L.GridLayer.extend({ this._map.on('drag', this._updateScrollOffset, this); }, + getEvents: function () { + var events = { + viewreset: this._viewReset, + moveend: this._move, + keypress: this._onKeyPress + }; + + if (!this.options.updateWhenIdle) { + // update tiles on move, but not more often than once per given interval + events.move = L.Util.throttle(this._move, this.options.updateInterval, this); + } + + if (this._zoomAnimated) { + events.zoomanim = this._animateZoom; + } + + return events; + }, + setUrl: function (url, noRedraw) { this._url = url; @@ -422,6 +441,11 @@ L.TileLayer = L.GridLayer.extend({ ' x=' + x + ' y=' + y + ' count=' + count); }, + _postKeyboardEvent: function(type, charcode, keycode) { + this._map.socket.send('key type=' + type + + ' char=' + charcode + ' key=' + keycode); + }, + _onMouseEvent: function (e) { if (e.type === 'mousedown') { this._selecting = true; @@ -493,6 +517,12 @@ L.TileLayer = L.GridLayer.extend({ this._map.on('mousedown mouseup mouseover mouseout mousemove dblclick', this._onMouseEvent, this); } + }, + + _onKeyPress: function (e) { + if (this._cursorMarker) { + this._postKeyboardEvent('input', e.originalEvent.charCode, e.originalEvent.keyCode); + } } }); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits