@d-healey yep it is very straight forward finally...
const var focusPnl = Content.getComponent("focusPnl"); const var overlayPnl = Content.getComponent("overlayPnl"); overlayPnl.showControl(false); focusPnl.setPaintRoutine(function(g) { g.fillAll(Colours.black); g.setColour(Colours.antiquewhite); g.drawAlignedText(this.data.hasFocus ? "HAS FOCUS" : "NOT FOCUSED", this.getLocalBounds(0.0), "centred"); }); focusPnl.setKeyPressCallback(function(ev) { if (ev.isFocusChange) { this.data.hasFocus = ev.hasFocus; // in definitive we just need to toggle the overlay, since the focus loss is made internally... overlayPnl.showControl(ev.hasFocus); this.repaint(); } }); HiseSnippet 1012.3ocsV0taaaCEkxNJn1qYXEnO.D9Wx.YF1cccCannNwerYzlDipzh9uBZIJKhPQ5QR4Tug79s2g8Rr2fsKkrrjWb75LvDLLz8ii3gWcuGpoJY.UqkJjSiqWsfhbdrq+JgIdPLgIPSFhb9R2KHZCUgycc9pEDslFhbbp+SVGNMNBkc8mu5bBmHBnktPn2KYAz2vRXlRuS6+ZFmOlDRulkTI6m2eRfTLPxko.ep61EsfDbCYN8RhMsZtHmiGExLRkugXnZjyQmKCW4GKuUjm+6YZ1LN0ZzC4COnb2ik7PKisdQChY7voE6aMBdJSKqB0yqBO08BVHai+xpwWkE.WhnZ8vo11zq9Vzq2CQucPImJT5nbJ8DW+.EagoLhkOeg6DA7xIh.k8pTIOWTs+nl6.IjgvzIgbCcrBL1fv6Ec6dJF9q8O1rIT50F7RhBGICR0SEb7KwEXmSMCjIKjBvvqUQBs.bkvjKoJNY09.VlhEZoUGMTjrPTRtWDgqoVF0rXc5nolova.yakoFlf5EkJBLLovad6l+VyFy6DAMTmw4d4MO5Ny3PmC7LfPZKCrd2DjHLreIkdaLyPyyITQt8LNatfFdM8SFOSLS2IjXHchI5wVVfeEt0OelOd7UCdmeK7Ofac4UWmaMZXqSwYHfM6ajAD94xTQn1qamtsOE2J.15JZncGe281VultZpBdcNfv4y.NWt0nKy1arHLbaGVNMfFQwbZ6lMfHM1AKeIFxsvB1ZMfeOPYtRhsWmY1CTQWXK0dVm2YYbAivRwkRC8JgWFwZdWS7+LTTzNisdI4T0NCaUAT6CnmHMYFUcJzlwSoaRDFM1dd63Ou4sf7dyJIJESDLyUKnqs2ufAZcyMb26lLDp+1A109f7VPUFlkNNCoKA0u7w2FtCo5aLxEfP1lIBfxlrnmTLbSDTNhAKcS2h1DzmJkHY8Wswnur+srPSLxw042A6XJadrwZEhxH4lE4jGZQdraYyQ0kAgVU0Xyx7gZUWFq0r4E50MNtHcXrJYedeVU2FXd69IOSpBoJe1ut0gI4deKIjkpq5eYw6Ym5n6KbBR1xvTNwrsNt8vq0AflssDOsBjBMyrp5ga+GD26tWw8OWJ9D2oLSP7t4XscvQnM7+CNt9HwSbGEEQCLkD7H2we3PO+6eY4yE5meAwnXPeo6koI9PKR.0J.BcuZa+WMaWdtcWqssB3SEgYF+EbsNXOqsy5f8JBhRHAJ4GCxkXrG59nLO.mDYeuQC3Ce.abOTlrCfyETzQIv4+eLHvt8+ZPcX2Xd1Af4aN.LO+.v7sG.lWb.X9tC.y2uWL1O85rTiLIeb.bLcTl9qiyHAA5rx5BQ+Mpcs8rASo as soon as you click the overlay panel, any other panel will lose the focus...
You just have to toggle the overlay and bam!
If you don't want the focus to be lost when clicking the keypress panel, just use 4 overlay panels that you dynamically place around it instead of using only one that covers the whole interface...