# Luakit Documentation / Modules / lousy.mode

# Module `lousy.mode`

lousy.mode library

Mode setting and getting operations for objects.

## Functions

### lousy.mode.is_modeable (object)

Check if the mode can be set on an object. An object is considered mode-able if it has an "emit_signal" method.

#### Parameters

- object
  Type: any type
  The object to check.

### lousy.mode.get (object)

Get the current mode for a given object.

#### Parameters

- object
  Type: any type
  A mode-able object.

#### Return Values

- string
  The current mode of the given object, or the default mode of that object, or "normal".

### lousy.mode.set (object, mode)

Set the mode for a given object.

#### Parameters

- object
  Type: any type
  A mode-able object.
- mode
  Type: string
  A mode name (e.g. "insert", "command", ...).

#### Return Values

- string
  The newly set mode.

## Attribution

#### Copyright

- 2010 Mason Larobina