Home Reference Source
import MorseIambicKeyer from 'morse-pro/src/morse-pro-keyer-iambic.js'
public class | source

MorseIambicKeyer

Extends:

MorseKeyer → MorseIambicKeyer

Constructor Summary

Public Constructor
public

constructor(keyCallback: function(): number, wpm: number, fwpm: number, frequency: number, iambicA: Boolean, messageCallback: function())

Member Summary

Public Members
public
public

iambicA: *

Private Members
private
private

Method Summary

Private Methods
private

_ditOrDah(input: *): *

Inherited Summary

From class MorseKeyer
public

decoder: *

public

ditLen: *

public

fditLen: *

public

fwpm: *

public
public

player: *

public

timer: *

public

wpm: *

private

_state: {"playing": *}

public

start()

Call this method when an initial key-press (or equivalent) is detected.

public

stop()

This method can be called externally to stop the keyer but is also used internally when no key-press is detected.

private

_check()

@access: private

private

_ditOrDah(input: *): *

Translate key input into whether to play nothing, dit, or dah

private

_playTone(duration: number)

Play a dit or dah sidetone.

Public Constructors

public constructor(keyCallback: function(): number, wpm: number, fwpm: number, frequency: number, iambicA: Boolean, messageCallback: function()) source

Override:

MorseKeyer#constructor

Params:

NameTypeAttributeDescription
keyCallback function(): number

A function which should return 0, 1, 2, or 3 from the vitual "paddle" depending if nothing, a dit, a dah or both is detected. This implementation will play dits if both keys are detected.

wpm number
  • optional
  • default: 20

Speed of the keyer (words per minute).

fwpm number
  • optional
  • default: 20

Farnsworth speed of the keyer.

frequency number
  • optional
  • default: 550

The frequency in Hz for the sidetone.

iambicA Boolean

if true then use iambic A mode, otherwise use iambic B mode (which sends an additional dit or dah when squeeze is released).

messageCallback function()

A function called with {message: string, timings: number[], morse: string} for each decoded part (see MorseDecoder). Its use here will result in a single character being returned each time.

Public Members

public ditGoesFirst: boolean source

public iambicA: * source

Private Members

private _lastDitOrDah: * source

private _lastInput: * source

Private Methods

private _ditOrDah(input: *): * source

Translate key input into whether to play nothing, dit, or dah

Override:

MorseKeyer#_ditOrDah

Params:

NameTypeAttributeDescription
input *

Return:

*