Products Technologies Demo Docs Blog Support Company

Insert Special Characters Using the Modifier Keys

The modifier key AltGr is commonly used to insert special characters or currency symbols. In some languages, it is used to insert accented characters. By default, TX Text Control implements the functionality of the CTRL modifier on the AltGr key as well. To implement the language specific functionality, you need to cancel the TX Text Control handling by trapping the keystrokes. As an example, the following code shows how to implement the Polish special characters ? and ? that are inserted…

Insert Special Characters Using the Modifier Keys

The modifier key AltGr is commonly used to insert special characters or currency symbols. In some languages, it is used to insert accented characters.

By default, TX Text Control implements the functionality of the CTRL modifier on the AltGr key as well. To implement the language specific functionality, you need to cancel the TX Text Control handling by trapping the keystrokes.

As an example, the following code shows how to implement the Polish special characters ż and ź that are inserted when pressing AltGr+Z and AltGr+X:

private void textControl1_KeyDown(object sender, KeyEventArgs e)
{
  if (e.Modifiers == (Keys.Alt | Keys.Control))
  {
    switch(e.KeyCode)
    {
      case Keys.Z:
        textControl1.Selection.Text = "ż";
        break;
      case Keys.X:
        textControl1.Selection.Text = "ź";
        break;
     }

     e.Handled = true;
  }
}

More about the different implementations of the AltGr key can be found here:

Wikipedia: AltGr key

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

Windows FormsWPF.NET

Create a Table of Contents in Windows Forms using C#

This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.


ASP.NETWindows FormsWPF

Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub

This article gives a quick overview of the new repositories, their structure and our plans for the future.


ASP.NETJavaScriptDocument Editor

Detect Toggle Button Changes Using a MutationObserver

This article shows how to detect changes of toggle buttons in the ribbon of the web editor using a MutationObserver. The state of a toggle button in the ribbon visualizes the state of a certain…


Windows FormsList.NET

Two Ways to Restart Numbered Lists in TX Text Control

In TX Text Control, numbered lists are continued by default and need to be reset when required. There is more than one way if you want to restart numbered lists in a document. In this article, two…


Windows FormsSampleShortcuts

Zoom Tricks: Disabling CTRL + MOUSE WHEEL and More

This article shows how to disable CTRL + MOUSE WHEEL, implement zooming with keyboard and reset the zoom factor to its default value.