You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: nsterm.m
    path of file: ./repos/remacs/src
    
    the code of the file until where you have to start completion: /* NeXT/Open/GNUstep / macOS communication module.      -*- coding: utf-8 -*-

Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2018 Free Software
Foundation, Inc.

This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify
it under
    
function key
         return a different key than was pressed (e.g. fn-<left> gives
         <home>).  We need to unset the fn modifier in these cases.
         FIXME: Can we avoid setting it in the first place?  */
      if (fnKeysym && (flags & NS_FUNCTION_KEY_MASK))
        emacs_event->modifiers ^= parse_solitary_modifier (ns_function_modifier);

      if (NS_KEYLOG)
        fprintf (stderr, "keyDown: code =%x\tfnKey =%x\tflags = %x\tmods = %x\n",
                 code, fnKeysym, flags, emacs_event->modifiers);

      /* If it was a function key or had control-like modifiers, pass
         it directly to Emacs.  */
      if (fnKeysym || (emacs_event->modifiers
                       && (emacs_event->modifiers != shift_modifier)
                       && [[theEvent charactersIgnoringModifiers] length] > 0))
        {
          emacs_event->kind = NON_ASCII_KEYSTROKE_EVENT;
          /* FIXME: What are the next four lines supposed to do?  */
          if (code < 0x20)
            code |= (1<<28)|(3<<16);
          else if (code == 0x7f)
            code |= (1<<28)|(3<<16);
          else if (!fnKeysym)
            {
#ifdef NS_IMPL_COCOA
              /* We potentially have both shift- and control-like
                 modifiers in use, so find the correct character
                 ignoring any control-like ones.  */
              code = ns_get_shifted_character (theEvent);
#end