# Setting up an use-key for many classes (c++)

**URL:** <https://forums.unrealengine.com/t/setting-up-an-use-key-for-many-classes-c/313152>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 30, 2015, 12:20pm UTC](https://forums.unrealengine.com/t/setting-up-an-use-key-for-many-classes-c/313152 "2015-03-30T12:20:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anonymous\_user\_3759fba9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3759fba9](https://forums.unrealengine.com/u/anonymous_user_3759fba9)\
**Post date:** [March 30, 2015, 12:55pm UTC](https://forums.unrealengine.com/t/setting-up-an-use-key-for-many-classes-c/313152/2 "2015-03-30T12:55:41Z")

</div>

Hi !

I think you should consider using Interfaces :

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

This will give you the ability to use the same functions (here, useKey()) on every class that implements the Interface, and to handle the use of the E key separately.

---

_[View the full topic](https://forums.unrealengine.com/t/setting-up-an-use-key-for-many-classes-c/313152)._
