1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 module com
{ module sun
{ module star
{ module awt
{
23 /** makes it possible to receive keyboard events.
25 * This key handler is similar to com::sun::star::awt::XKeyListener.
26 * But this handler is easier to use and more flexible for many
29 * This handler is usually added via
30 * com::sun::star::awt::XUserInputInterception to the controller from
31 * com::sun::star::frame::XModel. While
32 * com::sun::star::awt::XKeyListener needs to be added to exactly the
35 * Also this handler is more flexible then
36 * com::sun::star::awt::XKeyListener, because it optionally allows the
37 * consumption of key events. If a key event is consumed by one handler
38 * both the following handlers, with respect to the list of
39 * key handlers of the broadcaster, and a following handling by the
40 * broadcaster will not take place.
44 published
interface XKeyHandler
: ::com
::sun
::star
::lang
::XEventListener
46 /** This function is called by the broadcaster, an
47 ::com::sun::star::awt::XExtendedToolkit for
48 instance, after a key has been pressed but before it is released.
49 The return value decides about whether other handlers will be
50 called and a handling by the broadcaster will take place.
52 <p>Consume the event if the action performed by the implementation
53 is mutually exclusive with the default action of the broadcaster or,
54 when known, with that of other handlers.</p>
56 <p>Consuming this event does not prevent the pending key-release
57 event from being broadcasted.</p>
60 The key event informs about the pressed key.
62 When `FALSE` is returned the other handlers are called and a
63 following handling of the event by the broadcaster takes place.
64 Otherwise, when `TRUE` is returned, no other handler will be
65 called and the broadcaster will take no further actions
68 boolean keyPressed
([in] com
::sun
::star
::awt
::KeyEvent aEvent
);
70 /** This function is called by the broadcaster, an
71 ::com::sun::star::awt::XExtendedToolkit for
72 instance, after a key has been pressed and released. The return
73 value decides about whether other handlers will be called and a
74 handling by the broadcaster will take place.
76 <p>Consume the event if the action performed by the implementation
77 is mutually exclusive with the default action of the broadcaster or,
78 when known, with that of other handlers.</p>
81 The key event informs about the pressed key.
83 When `FALSE` is returned the other handlers are called and a
84 following handling of the event by the broadcaster takes place.
85 Otherwise, when `TRUE` is returned, no other handler will be
86 called and the broadcaster will take no further actions
89 boolean keyReleased
([in] com
::sun
::star
::awt
::KeyEvent aEvent
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */